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

How do I make it so only Prisoners change into criminals buy touching brick? [closed]

Asked by 4 years ago
Edited by Ziffixture 4 years ago

Here is my script. I am wandering how I could add to it so only prisoners turn into crims. I made it so when a team touches a wall they turn into crims.

--- code at bottom is where when its touched they change team

local RemoteEvent = game.ReplicatedStorage.ChangeTeam
local CriminalEvent = game.ReplicatedStorage.Criminals
local PoliceEvent = game.ReplicatedStorage.Police

local CrimFrame = game.StarterGui.ScreenGui.CrimsTeam

local PoliceDevice = game.Teams

local PoliceTeamTest = game.Teams.Police

local player = game.Players.LocalPlayer

local frame = script.Parent:WaitForChild("Frame")

local player = game.Players.LocalPlayer

local red = game.Workspace.Parts.RedBrick

local CitizensColor = "Lime green" 
local PoliceColor = "Cyan"
local PrisonersColor = "Bright orange"
local CriminalsColor = "Crimson"

frame.Prisoners.MouseButton1Click:Connect(function()
    RemoteEvent:FireServer(BrickColor.new(PrisonersColor))
end)


frame.Police.MouseButton1Click:Connect(function()
    RemoteEvent:FireServer(BrickColor.new(PoliceColor))
end)


frame.Citizens.MouseButton1Click:Connect(function()
    RemoteEvent:FireServer(BrickColor.new(CitizensColor))
end)


red.Touched:Connect(function()
    CriminalEvent:FireServer(BrickColor.new(CriminalsColor))
end)

game.ReplicatedStorage.Criminals.OnServerEvent:Connect(function(player,teamcolor)
    player.TeamColor = teamcolor
end)
0
Please put your code in code blocks Luka_Gaming07 534 — 4y

Closed as Not Constructive by Ziffixture

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?