I work on a roleplaying game where the player has to mount a radiator in a specific job. Now I want only the plumbers to be able to mount radiators, hence that I work on an item placement system. The only problem I face currently is that even though im in the correct team it still fails to detect me as the correct person. This here is the relevant, full script used.
script.Parent.Event.OnServerEvent:connect(function(player)
if player.Team == game.Teams.Haustechniker then
local backpack = player:WaitForChild("Backpack")
local character = player.Character or player.CharacterAdded:Wait()
local function purgeLaunchers(container)
for _, item in pairs(container:GetChildren()) do
if item:IsA("Tool") and item.Name:match("Abdeckvlies") then
item:Destroy()
script.Parent.Part.Transparency = 0
script.Parent.Event:Destroy()
script.Parent.Text:Destroy()
script.Parent.Range:Destroy()
end
end
end
purgeLaunchers(backpack)
purgeLaunchers(character)
end
end)
you need to check the color e.g: