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: Doesn't make it to the second function

Previous Thread :: Next Thread 
Ryloxx is not online. Ryloxx
Joined: 20 Sep 2011
Total Posts: 112
17 Aug 2015 04:13 PM
For some reason the script doesn't make it to the second function which changes the GUI's text.

Seat = script.Parent

Seat.ChildAdded:connect(function(NewObject)
local Child = NewObject
if Child.Name ~= "SeatWeld" then return end
Player = game.Players:GetPlayerFromCharacter(Child.Part1.Parent)
if Player ~= nil then
local Tool = script.CarGui:Clone()
GUI = Tool:Clone()
GUI.Parent = Player.PlayerGui
GUI.Frame.Visible = true
end
end
)

function changegas()
if GUI ~= nil then

while true do
txt=GUI.Frame.GasAmt
n=GUI.Frame.GasAmt.Max.Value
v=GUI.Frame.GasAmt.Gas.Value
txt.Text="Gas Left:"..(v).."/"..(n)
wait(1)
end
end
end

function speedcheck()
m=GUI.Frame.GasAmt.Gas.Value
n=GUI.Frame.GasAmt.Gas
a=script.Parent
if a.Throttle~=0 and m>0 then
n.Value=n.Value-1
a.MaxSpeed=100
wait(1)
else
a.MaxSpeed=0
wait()
end
end


Seat.ChildRemoved:connect(function(GuiRemove)
GUI:Destroy()
end
)
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
17 Aug 2015 04:15 PM
you never even call speedcheck lmao
Report Abuse
Ryloxx is not online. Ryloxx
Joined: 20 Sep 2011
Total Posts: 112
17 Aug 2015 04:21 PM
I'm a huge scripting noob, what do you mean by calling speedcheck? And the script doesn't even start the second function.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
17 Aug 2015 04:21 PM
i dont think you called your functions "changegas" or "speedcheck"
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
17 Aug 2015 04:22 PM
you have to call a function for it to work
example: speedcheck() will call the function
Report Abuse
Ryloxx is not online. Ryloxx
Joined: 20 Sep 2011
Total Posts: 112
17 Aug 2015 04:29 PM
I called both functions, yet the text still isn't changing. Is there something else, perhaps, wrong?
Report Abuse
laughablehaha is not online. laughablehaha
Joined: 19 Apr 2012
Total Posts: 2495
17 Aug 2015 04:32 PM
Can you repost this thread with the new script you made? this is confusing.
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
17 Aug 2015 05:46 PM
in this script you never callled it
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