So basically, I’ve scripted a tool so that if a player is holding it while clicking on the Zombie ragdoll, It will fire a remote and the script below handles it
- The script works. However, the main issue I’m having here is that the emit functions don’t even emit anything. The catch is if I add “wait(0.1)” before, they will emit the particles
I don’t want any delay so “wait(0.1)” is practically not a solution for me unless there are no other approaches. I appreciate any help if you’ve got any
(Script is server-sided and is located in ServerScriptService)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local GasCan = ServerStorage.GameStuff.Items:WaitForChild("GasCan")
local BurnCorpseEvent = ReplicatedStorage.Remotes:FindFirstChild("BurnCorpseEvent")
BurnCorpseEvent.OnServerEvent:Connect(function(Player, Corpse)
local Humanoid = Corpse:FindFirstChild("Zombie")
if Humanoid then
local burnsoundthingy = Instance.new("Sound")
burnsoundthingy.SoundId = "rbxassetid://7978512250"
burnsoundthingy.Volume = 1
burnsoundthingy.PlayOnRemove = true
burnsoundthingy.Parent = Corpse:FindFirstChild("HumanoidRootPart")
local fireeff = script.Fire:Clone()
fireeff.Parent = game.Workspace
fireeff.Position = Corpse:GetPivot().Position
local fire = fireeff.Attachment
--wait(0.1) i dont want this
fire["1"]:Emit(20)
fire["2"]:Emit(20)
fire["3"]:Emit(20)
fire["4"]:Emit(20)
fire["5"]:Emit(20)
game.Debris:AddItem(fireeff, 3)
local gas = GasCan:Clone()
gas.Parent = game.Workspace
gas.Position = Corpse:GetPivot().Position
Corpse:Destroy()
end
end)