script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer.leaderstats.Cash.Value == 100 then game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 75 script.Parent.Parent.Parent.OPen.Visible = true script.Parent.Parent.Parent.Sell.Visible = true game.ServerStorage.houses.House1:clone().Parent = game.Workspace script.Parent.Parent:Destroy()
game.ServerStorage.Items.Bank1:Clone() if game.ServerStorage.Items.Bank2.Parent == game.Workspace then game.Workspace.Bank2:Destory() end
end end)
First; please use a code block when posting code, and give us context. Second; always try to make your code neat and index it and everything. Also remember to leave notes for yourself so you can read what you wrote.
If this happens to help, please accept the answer!
Your problem is that you must've used the "clone" wrong. Please give me your error and this would be easier.
EDIT: Move the banks to ReplicatedStorage for this to work.
script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer.leaderstats.Cash.Value == 100 then game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 75 --this is all one line, so fix that. script.Parent.Parent.Parent.OPen.Visible = true --this line might be broken script.Parent.Parent.Parent.Sell.Visible = true --this line might be broken local a = game.ReplicatedStorage.houses.House1:Clone() a.Parent = workspace script.Parent.Parent:Destroy() game.ReplicatedStorage.Items.Bank1:Clone() --Use "replicatedStorage" instead! if game.ReplicatedStorage.Items.Bank2.Parent == game.Workspace then game.Workspace.Bank2:Destory() end end --make ends neat! end) --i think the lines making things visible is breaking, but I have no way to tell. just ignore this if the script works.
This isn't tested, but all I saw was that your "if" was in the wrong place! make a new line for that!