|
| 08 Sep 2015 11:30 PM |
Ok, so this script is supposed to work like this: You press Cntrl and you boost into the air. When you release cntr you fall. That part works. BUT, I have a meter gui so when you boost you run low on meter. (and eventaully, the meter runs out and you cant boost anymore) There is supposed to be about 2 second wait time before the meter recharges. BUT, the value isnt changing I have it set to. Even though Im telling it to, and of course, the value controls the meter gui. Whats wrong with this? --------------------------------------------Script Start line local Tool = script.Parent
Me=game:service("Players").LocalPlayer Char=Me.Character Mouse=Me:GetMouse() potato=script.Parent hold=false Char:MoveTo(Vector3.new(0,5000,0)) local fuel = Tool.CurrFuel.Value local maxFuel = 100 local regen = false
function GoUp() hold=true incr=0.25 if Char:FindFirstChild("DaForce") == nil then bp=Instance.new("BodyPosition",Char.Torso) bp.maxForce=Vector3.new(0,math.abs(Char.Torso.Velocity.y+(10^4*6)),0) bp.position=Char.Torso.Position bp.Name='DaForce' end while hold do wait() if incr < 11 then incr=incr+0.6 end pcall(function() bp.position=Char.Torso.CFrame*CFrame.new(0,incr,0).p end) end for _,v in pairs(Char.Torso:children()) do if v:IsA("BodyPosition") then v:Destroy() end end end Mouse.KeyDown:connect(function(lol1)--when its on if lol1 == string.char(50) and fuel > 0 then GoUp() wait() fuel=fuel-1 end end) Mouse.KeyUp:connect(function(lol1) --When its off if lol1 == string.char(50) then hold=false wait() regenFuel() end end)
function regenFuel()
while regen and hold==false do if fuel < maxFuel then wait(2) fuel = fuel + 1 Tool.CurrFuel.Value = fuel updateGUI() end wait(0.2) end
end
function updateGUI()
potato.Frame.Size = UDim2.new(0,40,0,300 * (Tool.CurrFuel.Value/maxFuel)) potato.Frame.Position = UDim2.new(0.9,0,0.2 + (0.2 * ((maxFuel - Tool.CurrFuel.Value)/maxFuel)),0)
end
Why front flip when you wash noodles? |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 08 Sep 2015 11:30 PM |
Its free modeled thats why
http://www.roblox.com/xla-item?id=290739801http://www.roblox.com/aser-item?id=290739819http://www.roblox.com/23-item?id=290739831 R$373 Tx1,984 |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2015 11:30 PM |
ALSO, I'm getting ZERO errors.
Why front flip when you wash noodles? |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2015 11:31 PM |
| Why not just switch the Humanoid.Jump = true?? |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2015 11:32 PM |
^^ Some parts of the script "CurrFuel" I copied because I wasnt understanding how you can make a value control a gui. Now I do (thanks to the fm) But, there actual boost part isnt.
Why front flip when you wash noodles? |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2015 11:34 PM |
Because I dont want it like that. I like Cntrl, the spacebar is going to be for normal jumps.
Why front flip when you wash noodles? |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2015 04:19 PM |
bump
Why front flip when you wash noodles? |
|
|
| Report Abuse |
|
|
| |
|