Untitled

 avatar
unknown
lua
3 years ago
859 B
2
Indexable
if (owner == "None") then
		if buy.Parent:FindFirstChild("Humanoid") then
			print("Buy is working")
			local player = game.Players:FindFirstChild((buy.parent.name))
			sound:Play()
			owner = player.name
			game.Workspace.HouseDoorParent.Door.SurfaceGui.TextLabel.Text = "Owned by: ".. owner
			game.Workspace.HouseDoorParent.DoorTrigger.Transparency = 1;
				game.Workspace.HouseDoorParent.DoorTrigger.CanTouch = false
			end
	elseif (owner ~= "None") then
	if sell.Parent:FindFirstChild("Humanoid") then
		print("Sell is working")
		sound:Play()
		local player = game.Players:FindFirstChild((sell.parent.name))
		owner = "None"
		game.Workspace.HouseDoorParent.Door.SurfaceGui.TextLabel.Text = "Owned by: "
		game.Workspace.HouseDoorParent.DoorTrigger.Transparency = 0.5;
		game.Workspace.HouseDoorParent.DoorTrigger.CanTouch = true
end)
Editor is loading...