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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 01 Mar 2015 10:48 AM |
| Are you testing this in Play Solo or Start Server? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 01 Mar 2015 10:49 AM |
| It's a normal script, right? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 01 Mar 2015 10:54 AM |
| Are you looking at server logs in F9? |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 01 Mar 2015 11:01 AM |
| It was working all along. Transparency = 1 makes it invisible. *facepalm* |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|