Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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.

2 comments

0

What is the point of lines 14 and 23? You have 'LocalPlayer' already defined on line 2.

0

Like I said that isnt the problem.

1 answer

✓ Accepted answer

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

local player = game.Players.LocalPlayer

3 comments

0

They're for the animations.

0

You know you can just use one.

0

Thats not what I need to know.

This discussion is preserved as it was. New answers, comments, and votes are closed.