Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I change this LocalScript into a regular script?

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?

1 answer

✓ Accepted answer

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)

1 comment

0

Thank you that works !

This discussion is preserved as it was. New answers, comments, and votes are closed.