What do you want to achieve? Keep it simple and clear!
Gui that appears after a few things happen
What is the issue? Include screenshots / videos if possible!
After the “things” happen the command to make the gui visible does not work.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
classic trouble shooting
this is a script, not a local script btw.
local Seat = script.Parent
local Screen = game.Workspace.PcScreen
local Light = game.Workspace["On/OffLight"]
local Part = game.Workspace.Part
Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if Seat.Occupant ~= nil then
local Char = Seat.Occupant.Parent
wait(.5)
Char["HumanoidRootPart"].Anchored = true
wait(.5)
Light.BrickColor = BrickColor.new("Lime green")
Seat.On:Play()
wait(1)
Seat.PcOn:Play()
wait(.5)
Screen.BrickColor = BrickColor.new("Baby blue")
wait(2.5)
game.StarterGui.MainPcScreen.MainScreen.Visible = true
print("It worked?")
end
end)
Why does this not work. Please help. (I get no errors) Also, The print I ran at the bottom of the script does print, but the gui does not work, almost like it skipped over it entirely.
Before I send you a possible way to fix the error, I think it is important that you try to solve it from the script properties in roblox studio. If it doesn’t work, try this:
local Seat = script.Parent
local Screen = game.Workspace.PcScreen
local Light = game.Workspace["On/OffLight"]
local Part = game.Workspace.Part
Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if Seat.Occupant ~= nil then
local Char = Seat.Occupant.Parent
wait(0.5)
Char.HumanoidRootPart.Anchored = true
wait(0.5)
Light.BrickColor = BrickColor.new("Lime green")
wait(1)
Seat.On:Play()
wait(1)
Seat.PcOn:Play()
wait(0.5)
Screen.BrickColor = BrickColor.new("Baby blue")
wait(2.5)
game.StarterGui:SetCore("GuiMainScreenOverride", true)
print("It worked?")
else
-- Reset the GUI and other actions here if the seat is unoccupied
end
end)
you can get the player object through player service if you already have the character
local playerService = game:GetService("Players")
local player = playerService:GetPlayerFromCharacter(character)
local playerGui = player:WaitForChild("PlayerGui")
Sorry about that roblox wont let me say small sentences for some reason, I fixed the character problem is what I could not say, it was named char not character,