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

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

Asked by
epicnt 13
4 years ago

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?

0
whats the error in the output Gameplayer365247v2 1055 — 4y
0
also when setting an Id you dont paste the whole link, instead you write "rbxassetid://"..tostring(id number in here) Gameplayer365247v2 1055 — 4y
0
there is no error in the output epicnt 13 — 4y
0
Check my updated answer! AddisonAvery 43 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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)
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 epicnt 13 — 4y
Ad

Answer this question