i'm trying to improve my race lights system, and i have a brick that clones itself and then drops on every player who is lined up at the start, as to give them a localscript that listens to a remote event, but it only clones the first time that the script runs, which is not what i want, can anyone help me here?
this is the part of the script that holds the clone function, i know the code isn't the best but i'm trying to make it simple
-- (there's more up here)
local cdclone = script.Parent.cdgiver:Clone()
local ting = 0 --debouncer
function onChatted(msg, recipient, speaker)
if ting == 0 then --debounce check
ting = 1 --activate debounce
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "start") then
cdclone.Parent = script.Parent
cdclone.Anchored = false
print("sent countdown gui")
script.Parent.sign.Part.RaceStart:play()--makes the start sound play (this is where the actual script starts)
sign1.Text = "everybody get ready! (5)"
wait(1)
sign1.Text = "everybody get ready! (4)"
wait(1)
sign1.Text = "everybody get ready! (3)"
wait(1)
sign1.Text = "everybody get ready! (2)"
cdclone.Anchored = true
cdclone.Position = script.Parent.cdgiver.Position
wait(1)
sign1.Text = "everybody get ready! (1)"
wait(1)
sign1.Text = "everybody get ready! (0)"
wait(1)
sign1.Text = "lights prepared."
wait(2)
--(there's more down here too)
