Need Help With my Script

Hello there,

I’m trying To Load a Gui with a ProximityPrompt Script and There’s No error’s In the output About The Script Idk If There’s something I’m doing or not? This is Also a LocalScript Btw.

local ProximityPrompt = script.Parent
local team = game.Teams.Boxer


ProximityPrompt.Triggered:Connect(function(player: Player)
	if player.Team == (team) ( player.PlayerGui:FindFirstChild("Gui")) then
script.Parent.ConnectScript.Enabled=true
	else
local gui = script["Error Boxer"]:Clone()
gui.Parent = player.PlayerGui
task.wait(5)
script["Error Boxer"]:Remove()
task.wait()

end
end)

If Someone Can Help that Would Be Great! :slight_smile:

Official_SimuIation

1 Like

You forgot the “and” in the if statement.
So:

if player.Team == team and player.PlayerGui:FindFirstChild("Gui") then
1 Like

Why are you adding “Task.wait()” at the end. Try to remove it

1 Like

Oh My Bad. Sorry about didn’t Noticed that.

1 Like

Isn’t that The Same As wait() ?

I Tried That and But nothing Still Came up Is there Something wrong Where I put player: Player?

Maybe try switching to a server script?
I feel like you can only use player (returned from ProximityPrompt.Trigged) on server scripts

1 Like

I found out why.

Local Scripts don’t run on workspace, put the Local Script inside StarterGui or use a Server Script.

Not anymore. With the beta feature enabled, local Scripts run everywhere.

Oh ok, new feature I guess, thats cool