#prompt enabling Gui

46 messages · Page 1 of 1 (latest)

verbal oriole
#

local DormPrompt = game.Workspace.TPparts.DormDoorTP1.DormSystem
local DormGui = script.Parent
local ExitDormButton = script.Parent.ExitDormButton

DormPrompt.Triggered:Connect(function(player)

DormGui.Enabled = true

end)

ExitDormButton.MouseButton1Click:Connect(function(player)

DormGui.Enabled = false

end)

#

also the same with disabling the screen gui when clicking a button, only the person who clicks it should disable it for only them!

umbral flame
#

such as:
if player == game.Players.LocalPlayer then
--player who triggered was the local player
end

#

although you could also turn it into a server script and fire a remote event to the player who needs their gui enabled

verbal oriole
umbral flame
verbal oriole
#

So if player == game.Players.LocalPlayer then

verbal oriole
verbal oriole
umbral flame
#

The gui enable

verbal oriole
#

So (if player == game.Players.LocalPlayer then game.StarterGui.DormGui.enabled = true)?

umbral flame
#

but like

#

format it

#
promptTriggered:Connect(function(player)
  if player == localPlayer then
    script.Parent.Enabled = true
  end
end)
umbral flame
#

starterGUI is the gui player's get when they spawn

verbal oriole
# umbral flame ```lua promptTriggered:Connect(function(player) if player == localPlayer then ...

local DormPrompt = game.Workspace.TPparts.DormDoorTP1.DormSystem
local DormGui = script.Parent
local ExitDormButton = script.Parent.ExitDormButton
local localPlayer = game.Players.LocalPlayer

DormPrompt.Triggered:Connect(function(player)
if player == localPlayer then
script.Parent.Enabled = true
end
end)

ExitDormButton.MouseButton1Click:Connect(function(player)
if player == localPlayer then
script.Parent.Enabled = true
end
end)

#

this is what i have i had to define local player cause it would underline it if i didint

#

is that ok?

umbral flame
#

yeah

#

but you dont need it for the

#

exit button

verbal oriole
#

Oh okay! Thank you!!😄

verbal oriole
# umbral flame yeah

wait it didint work, i forgot to test it but i just did and it did not even enable it

#

local DormPrompt = game.Workspace.TPparts.DormDoorTP1.DormSystem
local DormGui = script.Parent
local ExitDormButton = script.Parent.ExitDormButton
local localPlayer = game.Players.LocalPlayer

DormPrompt.Triggered:Connect(function(player)
if player == localPlayer then
script.Parent.Enabled = true
end
end)

ExitDormButton.MouseButton1Click:Connect(function(player)
if player == localPlayer then
script.Parent.Enabled = false
end
end)

umbral flame
#

also any errors?

verbal oriole
#

theres nothing in the output 🥲

umbral flame
#

buit can you show the hirearchy

#

also

#

it has to be a local script

#

for players.LocalPlayer to work

#

if youre using a server script then you have to use remote events

verbal oriole
umbral flame
#

the explorer

#

of the prompt

umbral flame
#

do that

verbal oriole
#

nvm ill test it

verbal oriole
#

i got this as soon i got in the game but the teleporting still works