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

Why wont this be put into the player?

So basically I'm trying to make a restaurant system but for whatever reason, this wont work. Any clue as to why?

Button = script.Parent.Screen.SurfaceGui.Frame.Button
Button.MouseButton1Click:Connect(function()
	local Player = game.Players.LocalPlayer.PlayerGui
	local ServerStorage = game.ServerStorage
	ServerStorage.MakeMenu:Clone().Parent = Player
	Button.Text = "Currently in use"
	Button.TextSize = 55
end)

Hope you can answer!

3 comments

0

Does this return any errors when run?

0

and is this a local script?

0

It isn't a local script. But I'm trying to insert it into the PlayerGui. The error says, " 22:24:53.707 - Workspace.OrderScreens.Screen.Script:3: attempt to index field 'LocalPlayer' (a nil value)"

1 answer

dude u attempted to get a player from a server script

5 comments

0

I put the code in a Local Script, but it still didn't work.

0

ok but at least u got that out of de wae

0

any errors when its in a local script instead?

0

@iiBuilder_Boy that thing is called Server Script not Local Script xd || look in your error. Workspace.OrderScreens.Screen.Script

0

that was the original

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