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
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 17 Aug 2015 04:15 PM |
| you never even call speedcheck lmao |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 17 Aug 2015 04:21 PM |
| i dont think you called your functions "changegas" or "speedcheck" |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 17 Aug 2015 04:32 PM |
| Can you repost this thread with the new script you made? this is confusing. |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 17 Aug 2015 05:46 PM |
| in this script you never callled it |
|
|
| Report Abuse |
|
|