|
| 14 Mar 2016 03:55 AM |
| idk but for some reason i am getting an error after i post a post so idk i hope this will work |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2016 04:00 AM |
so it worked hey so i want to make a script when the player holds a button down and when a car speed is more than 0 than a ligth on a car turns on but i am getting an eror and the ligth doesnt turn on can anyone help plz?
the script: local plr = game.Players.LocalPlayer local inputservice = game:GetService("UserInputService") local ligth = lightgame.Workspace.car.TruckBackBumper.TruckBackLigths.TruckBrakeLigthL.BrakeLigthL local seat = game.Workspace.car.TruckDriveSeat.VehicleSeat
while wait(0.1) do inputservice.InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.S and seat.Velocity.magnitude >= 0 then light.Enabled = true end end) while wait(0.1) do inputservice.InputEnded:connect(function(input) if input.KeyCode == Enum.KeyCode.S and seat.Velocity.magnitude >= 0 then light.Enabled = false end end)
i would be very thankfull if you help. |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2016 04:12 AM |
| can you please post the error code? |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2016 04:15 AM |
| for some reason when i post the error an roblox error happens and the post doesnt post |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2016 04:15 AM |
the error code
Workspace.JobansPooper.TruckBackBumper.TruckBackLigths.TruckBrakeLigthL.Script:18:
|
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Mar 2016 04:17 AM |
| (to close 'while' at line 12) |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Mar 2016 04:18 AM |
| sorry about the parts roblox didnt let me post the entire code in one post i hope you get it |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2016 04:43 AM |
you have 3 functions in each of these while wait(0.1) do inputservice.InputEnded:connect(function(input) if input.KeyCode == Enum.KeyCode.S and seat.Velocity.magnitude >= 0 then light.Enabled = false end end) so you need 3 ends while wait(0.1) do inputservice.InputEnded:connect(function(input) if input.KeyCode == Enum.KeyCode.S and seat.Velocity.magnitude >= 0 then light.Enabled = false end end) end |
|
|
| Report Abuse |
|
|