Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Trying to make a wing script. I keep failing.. can someone see what im doing wrong?

Asked by 9 years ago

Ok! This may be lengthy but here it goes! Im currently trying to make a Wing script kinda like this

local debounce = false

mouse.KeyPressed:connect(function(key)
if key:byte() == (E) then
if debounce then return end
debounce = true

--Here you will weld the wings to the player's back
--Here you will inject a flying script into the player

wait(25)

--Tell the player they have 5 Seconds of flight left

wait(5)

--remove wings
--remove flying script

debounce = false

wait(60) --Cool Down

end)

--We also want to make it so the player can press "E" again To turn it off if they have time left in
flight.. but they will still have 60 seconds of cool down

What i figured out, is i now have wings that appear when you spawn it (Code works) so now what i need it to do is -- When you first join the game the wings are transparent (wings spawn in the player its welded to them) then when they press "Left Control" It will set the transparency of the wings to .5 and give them a flying tool (I have that) Then wait (25) Tell them they have 5 seconds of flight left - wait (5) Set transparency to 0 and remove the flying script so they fall (They MUST WAIT 60 seconds to use the flying script again) -- (SIDE NOTE! I do want them to be able to press Left control at ANY TIME to be able to stop flying but they still have to wait 60 seconds!)

If you want to see my workspace here is a link :

1 answer

Log in to vote
1
Answered by 9 years ago

Nvm! I fixed it! I finally got it working!

MyMouse = game.Players.localPlayer:GetMouse()
Player = game.Players.localPlayer
debounce = false

MyMouse.KeyDown:connect(function(key)
    if (key:byte() == 50) then
        if debounce == true then return end
        debounce = true
    local human = Player.Character:FindFirstChild("TorsoWeld")
    local speed = Player.Character:FindFirstChild("Humanoid")
    human.Piece.Transparency = .5
    speed.WalkSpeed = 10
    game.Lighting["Fly"]:Clone().Parent = game.Players.LocalPlayer.Backpack
    wait(5)
    game.Lighting["warning"]:Clone().Parent = game.Players.LocalPlayer.PlayerGui
    wait(5)
    game.Players.LocalPlayer.PlayerGui.warning:Remove()
    human.Piece.Transparency = 1
    speed.WalkSpeed = 16
    game.Players.LocalPlayer.Backpack.Fly:Remove()
    Player.Character:FindFirstChild("Torso").BodyGyro:Remove()
    Player.Character:FindFirstChild("Torso").BodyVelocity:Remove()
    wait(1)
    game.Lighting["cooldown"]:Clone().Parent = game.Players.LocalPlayer.PlayerGui
    wait(5)
    game.Players.LocalPlayer.PlayerGui.cooldown:Remove()
    game.Lighting["readytofly"]:Clone().Parent = game.Players.LocalPlayer.PlayerGui
    wait(2)
    debounce = false
    game.Players.LocalPlayer.PlayerGui.readytofly:Remove()
    end
end)

0
I don't know how far you want to go,but you could put motors in the wings to make them flap Mystdar 352 — 9y
Ad

Answer this question