|
| 01 Jun 2015 07:09 PM |
I was referencing to the wiki as I've never really used Chat Commands.
local isAdmin = { ["helicopter35"] = true, ["Sealitey"] = true, ["Player"] = true }
function onChatted(message, player) if message == "load/Meadows" and isAdmin[player.Name] then game.Lighting.Map1Meadows:Clone().Parent = game.Workspace local h = Instance.new("Hint",game.Workspace) h.Text = "Meadows Loaded! Please wait for further instruction." end end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
Note; I'm fully aware that in studio, your player is called Player. |
|
|
| Report Abuse |
|
|
| |
|
EndOfFile
|
  |
| Joined: 31 May 2015 |
| Total Posts: 16 |
|
|
| 01 Jun 2015 07:18 PM |
| Told you, just like that idiotic bunny guy, you can't script. |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2015 07:20 PM |
It's not that I CAN'T script. It's that I'm having a problem with THIS script.
Say you were just beginning, how would you like it if someone just told you that you couldn't script. Well obviously, you're learning. And obviously, nobody is raised to learn scripting right off the bat.
I'll tell you this, if I didn't know scripting, I wouldn't be going to RDC. I applied specially for scripting, not building. You need to stop assuming, because you don't know half of what I can do. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 01 Jun 2015 07:22 PM |
Nope.
I tried Lighting and ServerStorage, didn't work. I've accomplished this with a Gui based holo with the same approach, just haven't attempted it with Chat Commands. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2015 08:22 PM |
| Is the hint every created? |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2015 08:25 PM |
| In his case, he does (or anything except nil/false) |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2015 08:30 PM |
local isAdmin = {"helicopter35","Sealitey","Player"}
function onChatted(message, player) if message == "load/Meadows" then local load = false for I,v in pairs(isAdmin:GetChildren()) do if player.Name == isAdmin[I] then load = true end end if load == true then local c = game.Lighting.Map1Meadows:Clone() c.Parent = game.Workspace local h = Instance.new("Hint",game.Workspace) h.Text = "Meadows Loaded! Please wait for further instruction." end end end
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 01 Jun 2015 08:31 PM |
| Can you guys stop changing it and actually help him... |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2015 08:40 PM |
local admins = {["helicopter35"] = true,["LegitimatlyMe"] = true,["Player1"] = true} local commands = { ["load"] = function(map) if map ~= nil then local h = Instance.new("Hint",game.Workspace) h.Text = "Loading "..map.Name..". Please wait." --rest of code end end }
game.Players.LocalPlayer.Chatted:connect(function(msg) if commands[string.match(msg,"%w+")] then commands[string.match(msg,"%w+")](string.sub(string.match(msg,"%s%w+"),2)) end end) |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2015 08:41 PM |
| no wait forgot the if statement to check if you're an admin |
|
|
| Report Abuse |
|
|
| |
|