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

Having a problem with my script executing. It’s not doing anything, nor is it outputting errors?

Asked by 4 years ago

Good Day Everyone, Today I want to say something and then when I say something it should light the person on fire. (Will Show a GIF). I want it to have a cooldown and I'm adding extra particles and stuff. https://gyazo.com/15307aa42d8f11c5c7d38d91bf4a6807

The issue is it won't work. I'm not sure whether I'm spamming something or anything with my code but, any help is greatly appreciated. The animations on my person won't even play. I'm guessing it's something wrong with my if-then statements but still.

I've tried to ask my friends, but they don't know as well. Any help is much appreciated. I will post my Local and Server Scripts below.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it's easier for people to help you!

Local Script

local Player = game:GetService('Players').LocalPlayer
local Mouse = Player:GetMouse()
local Replicated = game:GetService('ReplicatedStorage')
local Char = Player.Character
local Spell = "Ignis"
local AllowBurn = false
local Debounce = false

Player.Chatted:Connect(function(message)
    if message == Spell then
        AllowBurn = true
    end
end)

Mouse.Button1Down:Connect(function()
    if AllowBurn and not Debounce then
        AllowBurn = false
        local hum = Mouse.Target.Parent:FindFirstChild('Humanoid')
        if hum then
            Replicated:FindFirstChild('Ignis'):FireServer(hum,4456612982)
            Debounce = true
            wait(30)
            Debounce = false
        end
    end
end)

Server Script

game:FindFirstChild('ReplicatedStorage'):FindFirstChild('Ignis').OnServerEvent:Connect(function(plr,hum,animationID)
    local Radius = 6
    local Replicated = game:GetService('ReplicatedStorage')

    if (Player.Character:FindFirstChild("HumanoidRootPart").Position - hum.Parent:FindFirstChild("HumanoidRootPart").Position).magnitude <= Radius then

        local Fire1= Replicated.FireParticles:FindFirstChild('Fire')
        local Fire2 = Replicated.FireParticles:FindFirstChild('Fire2')
        local FireCore = Replicated.FireParticles:FindFirstChild('FireCore')

        local animation = Instance.new("Animation")
        animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationID

        local loadedAnimation = game.Workspace[Player.Name].Humanoid:LoadAnimation(animation)
        loadedAnimation:Play()

        local fire =Fire1:Clone()
        fire.Parent = hum.Parent:FindFirstChild('LeftHand')

        local fire2 =Fire2:Clone()
        fire2.Parent = hum.Parent:FindFirstChild('LeftHand')

        local firec =FireCore:Clone()
        firec.Parent = hum.Parent:FindFirstChild('LeftHand')


        local fire =Fire1:Clone()
        fire.Parent = hum.Parent:FindFirstChild('RightHand')

        local fire2 =Fire2:Clone()
        fire2.Parent = hum.Parent:FindFirstChild('RightHand')

        local firec =FireCore:Clone()
        firec.Parent = hum.Parent:FindFirstChild('RightHand')



        local fire =Fire1:Clone()
        fire.Parent = hum.Parent:FindFirstChild('LeftHand')

        local fire2 =Fire2:Clone()
        fire2.Parent = hum.Parent:FindFirstChild('LeftHand')

        local firec =FireCore:Clone()
        firec.Parent = hum.Parent:FindFirstChild('LeftHand')


        local fire =Fire1:Clone()
        fire.Parent = hum.Parent:FindFirstChild('LowerTorso')

        local fire2 =Fire2:Clone()
        fire2.Parent = hum.Parent:FindFirstChild('LowerTorso')

        local firec =FireCore:Clone()
        firec.Parent = hum.Parent:FindFirstChild('LowerTorso')



        local fire =Fire1:Clone()
        fire.Parent = hum.Parent:FindFirstChild('LeftFoot')

        local fire2 =Fire2:Clone()
        fire2.Parent = hum.Parent:FindFirstChild('LeftFoot')

        local firec =FireCore:Clone()
        firec.Parent = hum.Parent:FindFirstChild('LeftFoot')



        local fire =Fire1:Clone()
        fire.Parent = hum.Parent:FindFirstChild('RightFoot')

        local fire2 =Fire2:Clone()
        fire2.Parent = hum.Parent:FindFirstChild('RightFoot')

        local firec =FireCore:Clone()
        firec.Parent = hum.Parent:FindFirstChild('RightFoot')



end)

1 answer

Log in to vote
1
Answered by 4 years ago

In the server script you should be referencing plr, not Player. Also, it is easier if you just use plr.Character.Humanoid instead of looking for the player through workspace from the name for the animation load

0
Completely forgot about me changing the argument, I copy and pasted the radius line of code from my other script so that's why it didn't change. Thank you. JayShepherdMD 147 — 4y
0
Glad I could help! InfinityEngine 223 — 4y
Ad

Answer this question