For some reason, when part1 touched part 2, it detects but if it touches part3 it doesn’t detect. part3 appears to be behaving as if it were locked (can’t be selected) but it isn’t as I checked. What the hell is happening?
Can you show us your script? ?
function onTouched(part)
local original = game.Workspace.Splash
local copy = original:Clone()
local player = script.Parent.Player.Value
--print("Touched part")
--print("Loop running")
if part.Name == "Baseplate" then
-- print("Touched floor")
copy.Parent = game.Workspace.InkStorage
copy.Position = Vector3.new(script.Parent.Position.X, 0.001, script.Parent.Position.Z)
copy.BrickColor = player.TeamColor
script.Parent:Destroy()
elseif part.Parent == game.Workspace.InkStorage then -- here
if player.Team == game.Teams.White.TeamColor and part.BrickColor == game.Teams.Black.TeamColor then
part:Destroy()
copy.Parent = game.Workspace.InkStorage
copy.Position = Vector3.new(script.Parent.Position.X, 0.02, script.Parent.Position.Z)
copy.BrickColor = player.TeamColor
script.Parent:Destroy()
elseif player.Team == game.Teams.Black.TeamColor and part.BrickColor == game.Teams.White.TeamColor then
part:Destroy()
copy.Parent = game.Workspace.InkStorage
copy.Position = Vector3.new(script.Parent.Position.X, 0.02, script.Parent.Position.Z)
copy.BrickColor = player.TeamColor
script.Parent:Destroy()
else
copy.Parent = game.Workspace.InkStorage
copy.Position = Vector3.new(script.Parent.Position.X, 0.002, script.Parent.Position.Z)
copy.BrickColor = player.TeamColor
script.Parent:Destroy()
end
elseif part.Parent.Humanoid and part.Parent.Player.BrickColor ~= player.TeamColor then
local char = part.Parent
if not char:FindFirstChild("HealthV") then
local HC = game.StarterGui.HealthV:Clone()
HC.Parent = char
end
local Health = char:FindFirstChild("HealthV")
Health.Value -= 0.7
if Health.Value == 0 then
char.Humanoid.Health = 0
end
end
end
script.Parent.Touched:connect(onTouched)
The broken part is the first elseif
What is the Parent of the ‘part3’?
It is in game.Workspace.InkStorage
Can you show us the properties of part3
? Maybe something is causing it to change parents/destroy/etc
(yes both part1 and 3 are in the same collision group)