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: Can someone review this script?

Previous Thread :: Next Thread 
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
01 Mar 2015 10:37 AM
Hello, I am not getting any errors with this script, however it does not work as intended.

I am typing " /start " but the door is not changing.

Here is the script:

local door = script.Parent

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == string.lower("/start") then
door.Transparency = 1
door.CanCollide = false
wait(3)
door.Transparency = 0
door.CanCollide = true
end
end)
end)
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 10:42 AM
You should preform string.lower on msg instead of the command string, by the way.

Change the script to this and post the output.


game.Players.PlayerAdded:connect(function(player)
print(player.Name, "joined")
player.Chatted:connect(function(msg)
print(msg, string.lower(msg) == "/start")
if string.lower(msg) == "/start" then
door.Transparency = 1
door.CanCollide = false
wait(3)
door.Transparency = 0
door.CanCollide = true
end
end)
end)
Report Abuse
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
01 Mar 2015 10:46 AM
It didn't print anything, and door still did not open. :/
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 10:48 AM
Are you testing this in Play Solo or Start Server?
Report Abuse
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
01 Mar 2015 10:48 AM
I updated live game and tested it there, so not within studio.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
01 Mar 2015 10:49 AM
It's a normal script, right?
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
01 Mar 2015 10:50 AM
Prehistoric doesn't know what he's talking about. Here you go.

local door = script.Parent

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:lower() == "/start" then
door.Transparency = 1
door.CanCollide = false
wait(3)
door.Transparency = 0
door.CanCollide = true
end
end)
end)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
01 Mar 2015 10:50 AM
Oh wait. Is it because of Roblox's "/" system? I remember there being problems with that. Try replacing the slash with another character.
Report Abuse
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
01 Mar 2015 10:52 AM
@Jarod It's not a localscript. And I suppose I'll make it : instead of /

@Abstract thanks, I'll test it out and post results.

Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 10:54 AM
Are you looking at server logs in F9?
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 10:56 AM
Oh, it's a LocalScript. Change that, please.

PlayerAdded does not work locally. You will not need to run player adding events from each client anyway, so... why?????????

Once you've joined, your script runs. PlayerAdded fired WAY long ago before the script started running.
Report Abuse
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
01 Mar 2015 10:59 AM
@Prehistoric I just said it wasn't a localscript lol :P

@Abstract your edit didn't work. Door did not open.

here is the current script: (not a localscript)


local door = script.Parent

game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:lower() == ":start" then
door.Transparency = 1
door.CanCollide = false
wait(3)
door.Transparency = 0
door.CanCollide = true
end
end)
end)
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
01 Mar 2015 11:01 AM
It was working all along. Transparency = 1 makes it invisible. *facepalm*
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 11:01 AM
Oops, I'm blind. Can you screenshot the server logs and upload to push or i.mgur or something?
Report Abuse
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
01 Mar 2015 11:04 AM
OMG nevermind I fixed it xD

It seems the custom chat that Scripth's Admin uses wont recognize or allow this command.

So I disabled it and tried again and it worked just fine.

Thanks everyone for your help!
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