Player is apparently not defined still. Should I just test it anyway?
Have you tried the new code? (need 30 characters for send msg)
I have tried the new code. (30 char)
Could you send me picture of the code, how is it looking in roblox?
I closed and re-opened Analysis and the error has gone! Probably a Tab Bug! I’ll get a test on it right now.
The GUI still appears (30 char).
Are there in console any error, warnings or something like that?
Nothing relevant (30 chararcters).
Can you send me a photo of that code I sent you in Roblo Studio, I just want to know how does it look in there.
Where do you have the script stored?
ServerScriptService. Want me to move it?
Yeah, that’s the problem, ServerScriptService is only visible from server and not from client, I’d store it somewhere in the MorphSelection Gui.
Also, is it notmal script or LocalScript? That makes a lot of difference.
Normal script, I get the feeling it needs to be Local doesn’t it lol.
I think it should be local (at least it will be better), code:
local plr = game.Players.LocalPlayer
local gui = script.Parent
local arrestedTeam = game.Teams:WaitForChild("Arrested")
if plr.Team == arrestedTeam then
gui:Destroy()
end
plr:GetPropertyChangedSignal("Team"):Connect(function()
if plr.Team == arrestedTeam then
gui:Destroy()
end
end)
Put this code into LocalScript stored in the MorphSelection Gui, I’m pretty sure this one will work.
It worked! Thank you! Amazing. I’ve marked your previous message as the solution.
I’m happy to help (30 chars)
In this problem, it seems like you could just use the reverse operation. Instead of figuring out how to remove a Gui from a team, give the Gui only if the player is on the team. I think that’d be more straightforward, no? That’s how I’d usually approach this: instead of terms of disabling by team, I just don’t give the item at all if they don’t meet the requirements.