#prompt enabling Gui
46 messages · Page 1 of 1 (latest)
also the same with disabling the screen gui when clicking a button, only the person who clicks it should disable it for only them!
you could check if the player who triggered is the local player
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
I’d like this version instead of firing a remote event idk where to put it
on the proximity prompt trigger
So if player == game.Players.LocalPlayer then
yeah
Isint there supposed to be more script after the “then”?
Yes
What do I put?
The gui enable
So (if player == game.Players.LocalPlayer then game.StarterGui.DormGui.enabled = true)?
yeah
but like
format it
promptTriggered:Connect(function(player)
if player == localPlayer then
script.Parent.Enabled = true
end
end)
also not starterGUI
starterGUI is the gui player's get when they spawn
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?
Oh okay! Thank you!!😄
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)
can you show the hirearchy
also any errors?
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
whats that
nvm ill test it
i got this as soon i got in the game but the teleporting still works