Hello! So I am not asking for the difference between the two but rather asking what needs to be added/removed from a server script to make it a local script? Below is a script I put together in a server script but it does not work because I use which cannot be used in a server script. So how would I make this local?
local Button = script.Parent
Frame = script.Parent.Parent.Parent
EditBlock = script.Parent.Parent.Parent.Parent
OldOven = script.Parent.Parent.Parent.Parent.OldOven
NewOven = script.Parent.Parent.Parent.Parent.Oven
function onClick()
if game.Players.LocalPlayer.leaderstats.Money.Value >= 250 then
Frame.Enabled = false
EditBlock.Transparency = 1
local user = game.Players:GetPlayerFromCharacter(game.Players.LocalPlayer.Character) --get player from touching human
local stats = user:findFirstChild("leaderstats") --Find moneyholder
local cash = stats:findFirstChild("Money") --Get money
cash.Value = cash.Value -250
OldOven:Destroy()
NewOven.PartOne.Transparency = 0
NewOven.PartTwo.Transparency = 0
else
print("Not enough money!")
end
end
Button.MouseButton1Click:connect(onClick)

7 comments
im no expert but maybe try to move all that code into a local script?
Thanks for the suggestion but I have already tried this and I believe that it would require more than copying and pasting.
So, what player would you want to affect in a game? A random player? The owner? Who knows?
well it depends... is the player interacting with something? like clicking a button?
Writing LocalScripts vs. regular Scripts requires you to think and write your code in a totally different way. For example, since a LocalScript executes on a client (a player's computer), it makes sense for it to refer to a "local player"; the player that owns the script. However, regular Scripts, which execute on the server, have no concept of "local player" at all.
As server-side scripts should control the game for all players.
Thank you for the answer in the comment section :D