I’m trying to make a function where when a number value equals a curtain number, it clones a part. But I coded it, and it doesn’t work for some reason. Here’s the code I used:
local Part = game.ServerStorage.AddPart
if game.ReplicatedStorage.CoinNumber.Value == 7 then
print("Works")
local PartClone = Part:Clone()
PartClone.Parent = workspace
end
When you’re checking if an instance is changed, ensure that you’re checking that the instance itself is changed, and not the value of it. Also ensure that the variable you’re referencing is defined.