This is my code, I want it to set the vehicle speed to "200" when I chat go and to "0" when I chat stop, can't understand why this doesn't work.
01 | game.Players.PlayerAdded:connect( function (player) |
02 | if player.Name = = "Player" then |
03 | player.Chatted:connect( function (msg) |
04 | if msg = = "go" then |
05 | game.Workspace.xTranquil.Taxi.VehicleSeat.MaxSpeed = "200" |
06 | elif msg = = "stop" then |
07 | game.Workspace.xTranquil.Taxi.VehicleSeat.Maxspeed = "0" |
08 | end ) |
09 | end |
10 | end ) |
Lol on line 6 it says elif
. I'm sure you meant elseif
. That looks like the only error to me.
EDIT: I can't explain it, so I'm going to fix your code and tell you what I changed.
01 | game.Players.PlayerAdded:connect( function (player) |
02 | player.Chatted:connect( function (msg) |
03 | if player.Name = = "Player" then |
04 | if msg = = "go" then |
05 | game.Workspace.xTranquil.Taxi.VehicleSeat.MaxSpeed = "200" |
06 | elseif msg = = "stop" then --fixed that spelling mistake |
07 | game.Workspace.xTranquil.Taxi.VehicleSeat.Maxspeed = "0" |
08 | end --i added this end |
09 | end --moved the ) to the end below this one |
10 | end ) |
11 | end ) |