|
| 08 Sep 2013 12:02 PM |
This runs perfectly fine in Script builder, I've implemented this very simple admin command thing. However, when I respawn, I have to re-run it.. Any help? Thanks. (I know, I'm bad at keeping it neat) -- player = game.Players:WaitForChild("InternetGuy") char = workspace:WaitForChild("InternetGuy") version = "v1.0.0" chatBubble = false currentColor = Enum.ChatColor.Blue blue = Enum.ChatColor.Blue red = Enum.ChatColor.Red green = Enum.ChatColor.Green godMode = false function onChat(msg, player) if chatBubble == true then game:GetService("Chat"):Chat(char.Head, msg, currentColor) end if msg == "!reset" then char.Torso:Remove() elseif msg == "!cb" then chatBubble = true elseif msg == "!ncb" then chatBubble = false elseif msg == "!color red" then currentColor = red elseif msg == "!color blue" then currentColor = blue elseif msg == "!color green" then currentColor = green elseif msg == "!gm" then godMode = true elseif string.sub(msg,1,2) == "!m" then m = Instance.new("Message", workspace) m.Text = "[Admin] InternetGuy: " ..string.sub(msg,3) wait(3) m:Remove() end end
player.Chatted:connect(onChat)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 08 Sep 2013 12:14 PM |
-- May not work. player = game.Players:WaitForChild("InternetGuy") char = workspace:WaitForChild("InternetGuy") version = "v1.0.0" chatBubble = false currentColor = Enum.ChatColor.Blue blue = Enum.ChatColor.Blue red = Enum.ChatColor.Red green = Enum.ChatColor.Green godMode = false function onChat(msg, player) if chatBubble == true then game:GetService("Chat"):Chat(char.Head, msg, currentColor) end
if msg == "!reset" then char.Torso:Remove() elseif msg == "!cb" then chatBubble = true elseif msg == "!ncb" then chatBubble = false elseif msg == "!color red" then currentColor = red elseif msg == "!color blue" then currentColor = blue elseif msg == "!color green" then currentColor = green elseif msg == "!gm" then godMode = true elseif string.sub(msg,1,2) == "!m" then m = Instance.new("Message", workspace) m.Text = "[Admin] InternetGuy: " ..string.sub(msg,3) wait(3) m:Remove() end end
function respawn(c) c.Humanoid.Died:connect(function() player:LoadCharacter() -- Let's cut to the chase and respawn immediately. char = player.Character respawn(char) end) end respawn(char) -- Inception may cause error. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Sep 2013 12:41 PM |
| game.Workspace:WaitForChild("InternetGuy") |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2013 12:47 PM |
@War, That makes no difference. Workspace and game.Workspace are the same.
|
|
|
| Report Abuse |
|
|