if the proximity prompt script to open the gui is on the server it wont know when the client closes the script and still thinks the gui is still open and doesnt change the visibility.
if you want to keep it on the server just set the visibility to false first then to true, if you want it on the client you either create a remote to open the gui or handle the prompt on the client
Hi I decided to scrap the idea instead of a gui when you click the proximity prompt it will teleport you. issue i’m having now is when I click it nothing happens
script:
disabled = false
script.Parent.Proximityprompt.Triggered:connect(function()
if disabled == false then
disabled = true
game.Workspace.Teleport.RemoteFunction:InvokeServer()
wait(.2)
disabled = false
end
wait(.2)
script.Parent.BBRo:Connect(function() --[[ i will remove this part--]]
script.Parent.BBRo = workspace
end)
end)
I’m assuming this script is a Script object inside the proximity prompt’s parent so the reason why it doesnt work might be because InvokeServer is only used when communicating across the Client-Server boundary. In your case, youre trying to communicate Server-Server. If you want to communicate from one Script to the other, use Bindable Events instead
also if you’re teleporting the player, you could just put the teleporting script inside the function, up to you
I changed it to a normal script. I don’t know what a serverside script is? It still didn’t work The error comes up on the line where it says game.Workspace.Teleport.RemoteFunction:InvokeSever()
I got the Remotefunction in a folder with the teleport system is.
InvokeServer wont work when you use it in a normal script. When the RemoteFunction fires, if you are doing something on the client, use a RemoteEvent and use FireClient. If you are doing something on another script, use a BindableEvent
Hi thanks for your help, sadly it didn’t work I might’ve did something wrong. I did figure it out anyways by doing this: Instead I made a part with a proximityprompt inside a script.
Script:
local Proximityprompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
player.Character.HumanoidRootPart.Position = workspace.PartNameToTeleportTo.Position
Then I made another part and named it to PartNameToTeleportTo