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 5 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

01local Player = game:GetService('Players').LocalPlayer
02local Mouse = Player:GetMouse()
03local Replicated = game:GetService('ReplicatedStorage')
04local Char = Player.Character
05local Spell = "Ignis"
06local AllowBurn = false
07local Debounce = false
08 
09Player.Chatted:Connect(function(message)
10    if message == Spell then
11        AllowBurn = true
12    end
13end)
14 
15Mouse.Button1Down:Connect(function()
View all 26 lines...

Server Script

01game:FindFirstChild('ReplicatedStorage'):FindFirstChild('Ignis').OnServerEvent:Connect(function(plr,hum,animationID)
02    local Radius = 6
03    local Replicated = game:GetService('ReplicatedStorage')
04 
05    if (Player.Character:FindFirstChild("HumanoidRootPart").Position - hum.Parent:FindFirstChild("HumanoidRootPart").Position).magnitude <= Radius then
06 
07        local Fire1= Replicated.FireParticles:FindFirstChild('Fire')
08        local Fire2 = Replicated.FireParticles:FindFirstChild('Fire2')
09        local FireCore = Replicated.FireParticles:FindFirstChild('FireCore')
10 
11        local animation = Instance.new("Animation")
12        animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationID
13 
14        local loadedAnimation = game.Workspace[Player.Name].Humanoid:LoadAnimation(animation)
15        loadedAnimation:Play()
View all 81 lines...

1 answer

Log in to vote
1
Answered by 5 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 — 5y
0
Glad I could help! InfinityEngine 223 — 5y
Ad

Answer this question