Hello, I am trying to make a group only regen button, but for some reason when I click it the regen doesn't work. I'm so confused and is anyone here seeing something I'm not? Thank you for reading
location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() if player:IsInGroup (5310591) then regen:remove() local back = save:clone() back.Parent = location back:MakeJoints() end script.Parent.ClickDetector.MouseClick:Connect(function (player)
script.Parent.ClickDetector.MouseClick:Connect(function(player) -- when player clicks button -- put stuff inside function instead of above it if player:IsInGroup(5310591) then -- checks if player is in group -- does regen stuff location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() regen:remove() local back = save:clone() back.Parent = location back:MakeJoints() end end)