local EXP = script.Parent.Parent.EXP
local Gold = script.Parent.Parent.Gold
local ZP1 = game.Workspace.ZP1
while true do
wait(0.1)
if ZP1.CanCollide == true then
EXP.Value = EXP.Value + 1
Gold.Value = Gold.Value + 1
wait(0.2)
game.Workspace.ZP1.CanCollide = false
else
print("No EXP given.")
end
end
In the game, when the zombie is killed, it turns on CanCollide, which is supposed to trigger this script. However, it doesn't add the EXP or gold, even when CanCollide is on. Can someone help me with this? (btw it gives the exp to everyone)

6 comments
does it print no EXP given or nothing?
nope
if it doesn't print no EXP given then I can't see how it could not be doing the if statement since it's in a while loop. Try putting a print in the if statement?
is ZP1 a part
Yes.
Wait, the script wont run