script.Parent.Touched:Connect(function(touch)
local player = game.Players:GetPlayerFromCharacter(touch.Parent)
if player.Team["Trucker"] then
if touch.Name == "COAL" then
touch.Transparency = 0
end
end
end)
script.Parent.Touched:Connect(function(touch)
local player = game.Players:GetPlayerFromCharacter(touch.Parent)
if player then
if player.Team.Name == "Trucker" then
if touch.Name == "COAL" then
touch.Transparency = 0
end
end
end
end)
Perhaps it’s just that the coal itself does not touch the right part? try using print(touch.Name) to see which object touches
script.Parent.Touched:Connect(function(touch)
local player = game.Players:GetPlayerFromCharacter(touch.Parent)
if player then
if player.Team.Name == "Trucker" then
print(touch.Name)
if touch.Name == "COAL" then
touch.Transparency = 0
end
end
end
end)
script.Parent.Touched:Connect(function(touch)
local player = game:GetService("Players"):GetPlayerFromCharacter(touch.Parent)
if player then
if player.Team.Name == "Trucker" then
local truck = workspace.SpawnedCars:FindFirstChild(Player.Name.."'s Car")
truck:FindFirstChild("COAL",true).Transparency = 0
end
end
end)