There is this script that is for a quest where you face a villain. But when you get the quest it will notify the server. But when the npc dies everyone who is doing the quest gets money how do I fix this.
local NPC = game.Workspace["NPC That Follows You"]
game.ReplicatedStorage.fightingquest.OnServerEvent:Connect(function(player)
while true do
wait()
if NPC.Humanoid.Health <= 0 then
break
end
end
player.leaderstats.Jenny.Value += 5
--end
end)
