I do not understand what the problem is, is it a glitch, or is there something missing?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
I just got help on the following script, and it works fine.... Well there is one problem. Okay, so lets say I'm on the "Blue Team." I will get killed and that message will pop up. Lets say I switch to the "Red Team." The same will happen when I touch that wall. And now if I change to the "Taxi Driver" team I will go through fine. Yay, all works, but, if I change teams after becoming a taxi driver, I can still go through the wall unharmed and there is no GUI. Here is my script, maybe you can help me figure it out so that even after I become a taxi driver and change teams I cannot enter the wall/door.
01 | local Door = script.Parent |
05 | local modelname = "Taxi Driver" |
07 | function onTouched(hit) |
09 | local human = hit.Parent:FindFirstChild( "Humanoid" ) |
12 | if (human ~ = nil ) and (debounce = = false ) then |
13 | if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor = = game.Teams:FindFirstChild(modelname).TeamColor then |
17 | Door.CanCollide = false |
21 | local plr = game.Players:GetPlayerFromCharacter(hit.Parent) |
22 | local gui = Instance.new( "ScreenGui" , plr.PlayerGui) |
23 | local message = Instance.new( "TextLabel" , gui) |
24 | message.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
25 | message.BackgroundTransparency = 0.5 |
26 | message.Text = "Player was not a Taxi Driver" |
35 | Door.Touched:connect(onTouched) |
Ps. Thanks to the two guys who helped last time!