Hello everyone, recently I was coding a self check-in system for my hotel… I was running into some errors, I made it so when you click a part it opens a screen gui and then there is more buttons going to other screen guis… I encountered an error with it based off here:
I do not know where to start… So many issues you should probably be learning instead of scripting. Even if we fix your script you won’t understand what we have written, I am pretty sure no one wants to spoon-feed you. I suggest you read the developer wiki.
The StarterGui is all of the UI elements that are replicated over to each client,
You need to get the UI that is actually on the client. Inside of the Player there is a class called “PlayerGui”, that is UI’s that the player can view and see.
local Player = game:GetService("Players").LocalPlayer
local PlayerGui = Player.PlayerGui
local Rooms2 = PlayerGui.Rooms
It is basic but it seems like he has little to no experience in Lua. He can’t learn FE from writing random code that comes into his mind (just an example many other things in the script which are wrong). As you can see he is trying to access the local player from a server script and trying to enabled a ScreenGui inside a part.
Good skills but that is irrelevant to this topic. Also I am not saying that you are a bad programmer. We all have had 0 experience in a certain stage. I am just suggesting you to read the wiki or PiL. Try learning the basics and when you do so you can try experimenting with code of your own. If you get stuck we will always be here, you are new to Lua and just writing random code that comes in your mind is not a good idea.
This is a common misconception. Objects in StarterGui are cloned into the player’s PlayerGui object, which displays the ScreenGui. To enable it, you will have to use a local script, which means you must use a remote event, which when fired will enable the ScreenGui, like so:
--Server
local function clicked(player)
remoteEvent:FireClient(player)
end
clickDetector.MouseClick:Connect(clicked)
--Client
local player = players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local function serverEvent()
rooms1.Enabled = true
wait(.1)
bin.Enabled = false
end
remoteEvent.OnServerEvent:Connect(serverEvent)
You can see the PlayerGui in test mode in the explorer.
I don’t understand this, the underlined stuff… AlsoI already made the part open the screen guis on their own but I have a button in the screen guis that wont open another gui… That’s my issue okay?
Bumping a topic is when you post replies just to move the post up the list of recent posts or to ask the same question multiple times, it’s considered spam on these forums!
That’s also a misconception, that a RemoteEvent has to be used in this scenario. It doesn’t. The entire system for displaying the ScreenGui can be done wholly on the client. The server has no business here. The server only needs to get involved with any functionality that should not be entrusted to the client (such as the actual room assignment and granting of the key).