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

I'm really bad at debouncing help me with this?

Asked by
neoG457 315 Moderation Voter
9 years ago
local enabled = false
local player = game.Players.LocalPlayer

local mouse = player:GetMouse()
        mouse.KeyDown:connect(function(key)
        if not enabled then 
        enabled = true

    if key == "q" then 




local po = game.Players.LocalPlayer

local Discharge = Instance.new("Animation")
    Discharge.AnimationId = "http://www.roblox.com/Asset?ID=218063418"
local animTrack = po.Character.Humanoid:LoadAnimation(Discharge)
        animTrack:Play()

        wait(1)

        Player = script.Parent.Parent


        game:GetService("Chat"):Chat(Player.Character.Head, "Discharge!")


        x = Instance.new("Part")


        x.Reflectance = 0.5
        x.Size = Vector3.new(20, 20, 20)
        x.BrickColor = BrickColor.new("Bright yellow")
        x.TopSurface = "Smooth"
        x.BottomSurface = "Smooth"
        x.Shape = "Ball"
        x.Name = Player.Name
        x.Anchored = true
        x.CanCollide = false 
        x.Transparency = 0.6 
        y = Instance.new("BodyVelocity")
        y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
        y.velocity = Player.Character.Torso.CFrame.lookVector*80
        x.Parent = Workspace
        y.Parent = x
        x.CFrame = Player.Character.Torso.CFrame*CFrame.new(0, 0, 0)

    w.Part0 = x
    w.Part1 = Player.Character.Torso
    w.Parent = x






game.Debris:AddItem(x, 4)


    wait(10)
            enabled = true
                end
         end
    end)

It only lets me use the q key once but it should let me every 10 seconds

It is in a local script.

0
What is the point of lines 14 and 23? You have 'LocalPlayer' already defined on line 2. TheeDeathCaster 2368 — 9y
0
Like I said that isnt the problem. neoG457 315 — 9y

1 answer

Log in to vote
0
Answered by
woodengop 1134 Moderation Voter
9 years ago

This wouldn't answer your question but why are there 3

local player = game.Players.LocalPlayer
0
They're for the animations. neoG457 315 — 9y
0
You know you can just use one. woodengop 1134 — 9y
0
Thats not what I need to know. neoG457 315 — 9y
Ad

Answer this question