Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My Group-Only regen button does not work. It doesn't regen the car I made when I click?

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)

3 comments

0

hello, are you able to post the rest of the script beyond line 11?

0

Please post the entire script, as "player" is not defined. This question isn't really solvable unless we can see the script.

0

@NickyPlayz2011 Ok

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.