local time = script.Parent.Parent.respawn_time.Value while true do wait(time) local robo=script.Parent:clone() robo.Parent = game.Workspace robo.HumanoidRootPart.Position = script.Parent.RoboPosition.Position robo.Humanoid.WalkSpeed = robo.Parent.WalkSpeed.Value robo.Humanoid.MaxHealth = robo.Parent.Health.Value robo.Script:Destroy() end
everything looks good I dont knoe why. when i run it it says in the output "Workspace.Robos.Robo.RespawnScript:2: attempt to index nil with 'respawn_time'" even thought it is right
in line 1 use this
local time = script.Parent.Parent:WaitForChild("respawn_time").Value
if that still doesnt work
repeat wait() until script.Parent.Parent.respawn_time local time = script.Parent.Parent.respawn_time.Value
in case both of them doesnt work,u placed the respawn_time value at another place not script.Parent.Parent