Hi so im making a zombie game where the waves keep increasing, i use events to fire the server so I don't have to make a giant script, so how I want the waves to work is from a number value I created so everytime a zombie dies the value gets added by 1, so I basically want the zombies to be killed before each wave starts, but I have an error that the error wont show and it wont also run in this script
if Killed.Value == 4 then game.ReplicatedStorage.Events1.Wave2:FireServer() end --killed is the number value (local killed = game.Lighting,Killed)
i also tried while true do and it wouldn't work, if you know how to do this or fix this, please tell me!
You can use Value.Changed
Killed.Changed:Connect(function() if Killed.Value == 4 then game.ReplicatedStorage.Events1.Wave2:FireServer() end end)
try this:
local storage = game.ReplicatedStorage:FindFirstChild("Events1") local event = storage:FindFirstChild("Wave2") if Killed.Value == 4 then event:FireServer() end --killed is the number value (local killed = game.Lighting,Killed)