generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why doesn't this work?

Previous Thread :: Next Thread 
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
01 Jun 2015 07:16 PM
B1
Report Abuse
EndOfFile is not online. 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
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Jun 2015 07:21 PM
Any output?
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Jun 2015 08:22 PM
Is the hint every created?
Report Abuse
richardmaher is not online. richardmaher
Joined: 12 May 2014
Total Posts: 196
01 Jun 2015 08:24 PM
you dont need the = true
Report Abuse
cntkillme is not online. 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
EPICJAKEISCOOL is not online. EPICJAKEISCOOL
Joined: 07 Feb 2013
Total Posts: 1756
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 is not online. 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
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
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
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
01 Jun 2015 08:41 PM
no wait forgot the if statement to check if you're an admin
Report Abuse
helicopter35 is not online. helicopter35
Joined: 25 Oct 2010
Total Posts: 1225
01 Jun 2015 09:11 PM
I fixed it.

Thanks guys.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image