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
 

Hud movement script

Previous Thread :: Next Thread 
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
18 Dec 2014 03:12 PM
can someone make this cleaner, using freefall function etc, etc? I have a double jump function and now it doesn't work well and I'm trying to make my FPS script. It would be greatly appreciated.


local p = game.Players.LocalPlayer
repeat wait() until p.Character
local c = p.Character
local hum = c:WaitForChild("Humanoid")

function HudFix()
local hud = script.Parent
local x = 0
hud:TweenPosition(UDim2.new(.01, 0, 1, -185), "Out", "Quad", .3, true)
end

function HudJump()
local hud = script.Parent
local i = 0
hud:TweenPosition(UDim2.new(.01, 0, 1, -150), "Out", "Quad", .3, true)
wait(.4)
HudFix()
end

while true do
repeat
wait()
until hum.Jump == true
HudJump()
wait(.3)
end


Mr. Mustachio | ( ͡°╭͜ʖ╮͡° )
Report Abuse
KillCity is not online. KillCity
Joined: 22 Mar 2012
Total Posts: 383
19 Dec 2014 04:43 AM
local p = game.Players.LocalPlayer
repeat wait() until p.Character
local c = p.Character
local hum = c:WaitForChild("Humanoid")

local hud = script.Parent

function HudFix()
hud:TweenPosition(UDim2.new(.01, 0, 1, -185), "Out", "Quad", .3, true)
end

function HudJump()
hud:TweenPosition(UDim2.new(.01, 0, 1, -150), "Out", "Quad", .3, true)
end

hum.StateChanged:connect(function(_, state)
if state == Enum.HumanoidStateType.Jumping or state == Enum.HumanoidStateType.Freefall then
HudJump()
end
if state == Enum.HumanoidStateType.Landed then
HudFix()
end
end)

may or may not work
idk
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
19 Dec 2014 11:53 AM
works, thank you

#ScriptMasterRace
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