Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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)
0
hello, are you able to post the rest of the script beyond line 11? HEMAN_9 70 — 3y
0
Please post the entire script, as "player" is not defined. This question isn't really solvable unless we can see the script. NickyPlayz2011 82 — 3y
0
@NickyPlayz2011 Ok alialan626 25 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
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)
Ad

Answer this question