Cloning script doesn't work

What do you want to achieve?
I would like this script to detect when a timer value reaches a certain number and then clone a zombie from replicated storage and move it to a folder that spawns zombies to make the round harder as it progresses

What is the issue?
For some reason the script doesn’t do anything when the value reaches a number and it doesn’t say anything in the output

What solutions have you tried so far?
I used GetPropertyChangedSignal(‘Value’) but it didn’t do anything

local zombieContainer = script.Parent.Parent:WaitForChild("ZombieContainer")
local status = script.Parent.Parent:WaitForChild("Status")

status:GetPropertyChangedSignal('Value'):Connect(function()
	if status.Value == "TIME: 15 then
		local clone = script.Parent.GiantZombie:Clone()
		clone.Name = "Zombie"
		clone.Parent = zombieContainer
	end
end)

is status a string value or an int value?

The status value is a string value

You didn’t close off the “TIME: 15”

1 Like

I did but the script is still doing nothing

Put a print statement outside and inside the if statement to see what part is the issue.

I did but nothing would print when testing the game

In which case the function isn’t detecting any change. Since you’re only running the function for a change in the actual value, a .Changed function will work fine. If that doesn’t work then its the script for the timer that’s the issue.

Changed: StringValue | Roblox Creator Documentation

I think it could be with the timer script because when making the script I did status.Changed but changed it to GetPropertyChangedSignal