Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I change this LocalScript into a regular script?

Asked by
Seraine 103
10 years ago
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

Log in to vote
1
Answered by 10 years ago

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)

0
Thank you that works ! Seraine 103 — 10y
Ad

Answer this question