Can you add it for me? I can't figure out how to do it.
local debounce = false function onTouch(hit) if hit == nil then return end if hit.Parent == nil then return end if not game.Workspace:FindFirstChild("Home"..hit.Parent.Name) then if game.Players:findFirstChild(hit.Parent.Name) ~= nil and debounce == false then debounce = true local b = script.Parent.Parent:Clone() b.Parent = game.Lighting b.Name = "Home"..hit.Parent.Name wait(.4) script.Parent.Parent.OwnerName.Value = hit.Parent.Name script.Parent.Head:Remove() script.Parent.Parent.Thing.Head.SurfaceGui.TextLabel.Text = "Home Owner: "..hit.Parent.Name script.Parent.Parent.Parent.Name = "Home"..hit.Parent.Name end else end wait(3) debounce = false end script.Parent.Head.Touched:connect(onTouch)
Well, I'm presuming you want them to be in the group to get the house of some sort.
local debounce = false local ID = 1337 -- Group ID function onTouch(hit) if hit == nil then return end if hit.Parent == nil then return end if not game.Workspace:FindFirstChild("Home"..hit.Parent.Name) then if game.Players:findFirstChild(hit.Parent.Name) ~= nil and debounce == false and game.Players:GetPlayerFromCharacter(hit.Parent):IsInGroup(ID) then debounce = true local b = script.Parent.Parent:Clone() b.Parent = game.Lighting b.Name = "Home"..hit.Parent.Name wait(.4) script.Parent.Parent.OwnerName.Value = hit.Parent.Name script.Parent.Head:Remove() script.Parent.Parent.Thing.Head.SurfaceGui.TextLabel.Text = "Home Owner: "..hit.Parent.Name script.Parent.Parent.Parent.Name = "Home"..hit.Parent.Name end else end wait(3) debounce = false end script.Parent.Head.Touched:connect(onTouch)