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: speed

Previous Thread :: Next Thread 
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
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
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
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
PyroChiliarch is not online. PyroChiliarch
Joined: 24 Sep 2013
Total Posts: 11
14 Mar 2016 04:12 AM
can you please post the error code?
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
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
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
14 Mar 2016 04:15 AM
the error code


Workspace.JobansPooper.TruckBackBumper.TruckBackLigths.TruckBrakeLigthL.Script:18:
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
14 Mar 2016 04:16 AM
'end' expected
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
14 Mar 2016 04:17 AM
(to close 'while' at line 12)
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
14 Mar 2016 04:18 AM
near
eof
Report Abuse
TroubleDOG0100 is not online. TroubleDOG0100
Joined: 16 Sep 2014
Total Posts: 171
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
LuaDeveloped is not online. LuaDeveloped
Joined: 28 Jan 2016
Total Posts: 439
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
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