Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I do not understand what the problem is, is it a glitch, or is there something missing?

Asked by 8 years ago

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.

01local Door = script.Parent
02 
03debounce = false
04 
05local modelname="Taxi Driver"
06 
07function onTouched(hit)
08        print("Door Hit")
09        local human = hit.Parent:FindFirstChild("Humanoid")
10 
11 
12        if (human ~= nil ) and (debounce == false) then
13if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor==game.Teams:FindFirstChild(modelname).TeamColor then
14            debounce = true
15                        Door.Transparency = 1
View all 38 lines...

Ps. Thanks to the two guys who helped last time!

0
You never set Door.CanCollide to true after disabing it. GoldenPhysics 474 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Golden did find an error, but that still won't harm them, you forgot to reset debounce.

Ad

Answer this question