function Click(mouse) game.Workspace.House1:remove() clone = game.Lighting.House1:clone() clone.Parent = game.Workspace game.Players.LocalPlayer.Cash.Value = game.Players.LocalPlayer.Cash.Value+500 game.Players.LocalPlayer.HasHouse.Value = false script.Parent.Parent:remove() end script.Parent.MouseButton1Down:connect(Click)
I used LocalPlayer so it only work in play solo, but what do I have to change so that this would work in server mode?
I am assuming this is a GUI
function Click(mouse) plr=script.Parent.Parent.Parent.Parent -- I am assuming it is a TextButton, in a Frame, in a ScreenGui, in StarterGui(PlayerGui) in the player. Change this to whatever you need it. game.Workspace.House1:remove() clone = game.Lighting.House1:clone() clone.Parent = game.Workspace plr.Cash.Value = plr.Cash.Value+500 plr.HasHouse.Value = false script.Parent.Parent:remove() end script.Parent.MouseButton1Down:connect(Click)