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