Script 1: (Main script)

                                                                                                     --[[
	Copyright® 2015 Code Much? 
                                                                                                      --]]
local debounce = false
local ID = 753277 -- 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)

Script 2: (Sellhome)

                                                                                                     --[[
	Copyright® 2015 Code Much? 
                                                                                                      --]]
function onButtonClicked()
local x = game.Workspace:FindFirstChild("Home"..script.Parent.Parent.Parent.Parent.Name)
if not (x) then
return
else
x.Home:Remove()
x.Name = "Home"
wait(.5)
s = game.Lighting["Home"..script.Parent.Parent.Parent.Parent.Name]
s.Parent = x
s.Name = "Home"
end
end
script.Parent.MouseButton1Down:connect(onButtonClicked)

Script 3: Lock/Unlock doors

                                                                                                     --[[
	Copyright® 2015 Code Much? 
                                                                                                      --]]
function onButtonClicked()
local z = game.Workspace:FindFirstChild("Home"..script.Parent.Parent.Parent.Parent.OwnerName)
if not (z) then
return
else
if script.Parent.Text == "Lock House Doors" then
script.Parent.Text = "Unlock House Doors"
z.Home.FDoor.CanCollide = true
z.Home.BDoor.CanCollide = true
z.Home.GDoor.CanCollide = true
elseif script.Parent.Text == "Unlock House Doors" then
script.Parent.Text = "Lock House Doors"
z.Home.FDoor.CanCollide = false
z.Home.BDoor.CanCollide = false
z.Home.GDoor.CanCollide = false
end
end
end
script.Parent.MouseButton1Down:connect(onButtonClicked)

2 comments

0

What do you want us to do?

1

Your question is too vague; What is the problem? You are not providing nothing more than 'Why isn't the code working'! Was there any Output? If so, what did it say? What about it isn't working? These are all important question that are REQUIRED.