User:Anaminus/Script:Messages: Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
m
no edit summary
>Anaminus No edit summary |
>Anaminus mNo edit summary |
||
Line 1: | Line 1: | ||
<pre> | <pre> | ||
speakers = {"Anaminus"} | |||
function check(name) | function check(name) | ||
for i,v in pairs(speakers) do | |||
for i | if (string.upper(name) == string.upper(v)) then return true end | ||
if (string.upper(name) == string.upper( | |||
end | end | ||
return false | return false | ||
end | end | ||
function | function debug(p) | ||
for i,v in pairs(p:GetChildren()) do | |||
if v.className == "Message" or v.className == "Hint" then | |||
if | v:Remove() | ||
else | |||
debug(v) | |||
end | end | ||
end | end | ||
end | |||
game.Players.PlayerAdded:connect(function(newPlayer) | |||
newPlayer.Chatted:connect(function(msg) | |||
local source,msg = string.lower(newPlayer.Name),string.lower(msg) | |||
if not check(source) then return end | |||
if | if msg:sub(1,3) == "/m " then | ||
local message = Instance.new("Message") | |||
message.Text = msg:sub(4) | |||
message.Parent = workspace | |||
wait(5) | |||
message.Parent = nil | |||
end | |||
if msg:sub(1,3) == "/h " then | |||
local hint = workspace:FindFirstChild("Hint") | |||
if hint == nil then | |||
hint = Instance.new("Hint") | |||
hint.Parent = workspace | |||
end | |||
hint.Text = msg:sub(4) | |||
end | |||
if msg:sub(1,3) == "/rh" then | |||
local hint = workspace:FindFirstChild("Hint") | |||
if hint ~= nil then | |||
hint:Remove() | |||
end | end | ||
end | end | ||
if msg:sub(1,3) == "/dm" then | |||
debug(game) | |||
end | |||
end) | |||
end)</pre> | |||
end | |||
end | |||
</pre> |