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

My whiteThunderRasengan script won't work, is it because of the debounce?

I tried to make a whiteThunderRasengan script it worked a bit at the start(only animation would run, it won't create the Rasengan idk why) then I added debounce but it still doesn't wait for it to be finished to do anything else.

Here's the code:

local RS = game:GetService("ReplicatedStorage")
local RE = RS.boll

local debounce = false

RE.onServerEvent:Connect(function(player)
	if debounce then
	debounce = true 
	
	local char = player.Character
	local hum = char:WaitForChild("Humanoid")
	
	local animation = Instance.new("Animation", workspace)
	animation.AnimationId = "http://www.roblox.com/Asset?ID=4803113473"
	local animTrack = hum:LoadAnimation(animation)
	animTrack:Play()
	
	local whiteThunderRasengan = Instance.new("Part", player)
	whiteThunderRasengan.Shape = "Ball"
	whiteThunderRasengan.Color = Color3.fromRGB(255,255,255)
	whiteThunderRasengan.Anchored = true
	whiteThunderRasengan.CanCollide = false
	whiteThunderRasengan.Massless = true
	whiteThunderRasengan.Material = "Neon"
	whiteThunderRasengan.Size = Vector3.new(2,2,2)
	
    whiteThunderRasengan.Orientation = char:WaitForChild("Left Arm").Position
	whiteThunderRasengan.Position = char:WaitForChild("Left Arm").Position	
		
		debounce = false	
	end
end)

What should I do?

4 comments

0

whats the error in the output

0

also when setting an Id you dont paste the whole link, instead you write "rbxassetid://"..tostring(id number in here)

0

there is no error in the output

0

Check my updated answer!

1 answer

✓ Accepted answer

The issue here is, that you only check if debounce EXISTS. You want to check the value, too.

Edit: I figured out what's wrong! The issue is, you create the part in the player, not the character!

I've also updated the script, hope it works!

local RS = game:GetService("ReplicatedStorage")
local RE = RS.boll

local debounce = false

RE.onServerEvent:Connect(function(player)
    if debounce == false then
    debounce = true 

    local char = player.Character
    local hum = char:WaitForChild("Humanoid")

    local animation = Instance.new("Animation", workspace)
    animation.AnimationId = "http://www.roblox.com/Asset?ID=4803113473"
    local animTrack = hum:LoadAnimation(animation)
    animTrack:Play()

    local whiteThunderRasengan = Instance.new("Part", char)
    whiteThunderRasengan.Shape = "Ball"
    whiteThunderRasengan.Color = Color3.fromRGB(255,255,255)
    whiteThunderRasengan.Anchored = true
    whiteThunderRasengan.CanCollide = false
    whiteThunderRasengan.Massless = true
    whiteThunderRasengan.Material = "Neon"
    whiteThunderRasengan.Size = Vector3.new(2,2,2)

    whiteThunderRasengan.Orientation = char:WaitForChild("Left Arm").Position
    whiteThunderRasengan.Position = char:WaitForChild("Left Arm").Position  

        debounce = false
else
	print("waiting..")
    end
end)

1 comment

0

Thanks, but it still won't let it finish before doing it again, I check by spamming and my whiteThunderRasengan still won't pop up

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