So I have a Buyable house system and when you click the door it checks if you have 500 cash and if you do you lose that 500 cash to it and the StringValue named CurrentOwner makes its value the players name but when its bought I put it where it makes the Guys in the door its self and the Billboard Gui in a part name GuiPart have the visible choice switched to false so nobody thinks they can buy it, but the Gui's won't go invisible, and I also have a script where when the house is bought a mailboxes Billboard GUI text should change to the players name for example like (Example: Owner: vincentthecat1), but all it does is nothing and the script for it to change is in a part name GuiPart1.

---Key--- .GuiPart has a BillboardGui name BillboardGui1.

.GuiPart1 has a BillboardGui that is named BillBoardGui and the Part is in a Model named MailBox that is in a model name Door.

.The door has a script named Buy and a script named Enter and a Script named Leave StringValue named CurrentOwner with a SurfaceGui name SurfaceGui6.

---Scripts--- .Buy Script(Notfully working)

local owner = script.Parent.CurrentOwner.Value
local price = 500

script.Parent.ClickDetector.MouseClick:Connect(function(Player)
	if owner == "" then
		if Player.leaderstats.Cash.Value >= price then
			Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value - price
			script.Parent.CurrentOwner.Value = Player.Name
		if script.Parent.CurrentOwner.Value == Player.Name then
			if script.Parent.GuiPart.BillboardGui1.Imagelabel.Visible == true then
				script.Parent.GuiPart.BillboardGui1.ImageLabel.Visible = false
		if script.Parent.SurfaceGui6.TextLabel.Visible == true then
			script.Parent.SurfaceGui6.TextLabel.Visible = false
		end
		end
		end
		end
	end
end)

.Enter Script(Works)

script.Parent.Touched:Connect(function(hit)
	if hit.Parent.Name == script.Parent.CurrentOwner.Value then
		script.Parent.Transparency = 1
		script.Parent.CanCollide = false
		wait(3)
		script.Parent.Transparency = 0
		script.Parent.CanCollide = true
	end
end)

.GuiPart1 Script(Won't work at all)

while true do
	wait(0)
	script.Parent.Text = ("Owner: " .. script.Parent.Parent.Parent.CurrenctOwner.Value)
end

.Leave Script(Works)

game.Players.PlayerRemoving:Connect(function(Player)
	if Player.Name == script.Parent.CurrentOwner.Value then
		script.Parent.CurrentOwner.Value = ""
	end
end)

2 comments

0

i dont know, it seems like right

0

Yeah but it won't work with the GuiPart1 script and the buy script.