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

why will it stay the same team if I am a Police and touch the part?? Please Help!

Asked by 5 years ago
Edited 5 years ago

Hello, I have made this code where when a prisoner or citizen hits a part they change to crims. It succefully worked. I wanted it so if a police toches the part it will stay the same team but it did not work. Please have a look at my code and see if you can help me fix it. The main code needing to be fixed is at the very bottom.

The main code is at the bottom.

01local RemoteEvent = game.ReplicatedStorage.ChangeTeam
02local CriminalEvent = game.ReplicatedStorage.Criminals  -- variables
03local PoliceEvent = game.ReplicatedStorage.Police
04 
05local CrimFrame = game.StarterGui.ScreenGui.CrimsTeam -- ignore this and go to bottom
06 
07local PoliceDevice = game.Teams
08 
09local PoliceTeamTest = game.Teams.Police
10 
11local player = game.Players.LocalPlayer
12 
13local frame = script.Parent:WaitForChild("Frame")
14 
15local player = game.Players.LocalPlayer
View all 48 lines...
0
Can you show us the remote events's code? jackochjulius 2 — 5y
0
A. Why are you doing Touched on the client B. Why are you attempting to change the TeamColor locally DeceptiveCaster 3761 — 5y
0
Hey jack! Sure I will do that later TgaTheGoldenArmour 15 — 5y
0
Why are you using team colour as a comparison, why not just check the player team itself. Maybe you should, in the remote event stuff, check if the player is not a police, then change it, instead of changing it back. Phyrixia 51 — 5y

Answer this question