Hello, I have a script that uses tags for the checkpoints it works when a part outside of the map folder is given the tag but in the map folder it doesnt work
local cs = game:GetService("CollectionService")
local remoteEvent = game.ReplicatedStorage.FakeRespawnPlayer
local electricSound = script.ShockLoop
for _, part in cs:GetTagged("resetBrick") do
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
print("Damage hit")
hit.Parent.HumanoidRootPart.Position = game.Players:GetPlayerFromCharacter(hit.Parent):GetAttribute("CurrentCheckpoint")
end
end)
local soundClone = electricSound:Clone()
soundClone.Parent = part
soundClone:Play()
print("Playing Sound")
end
for _, part in cs:GetTagged("checkpoint") do
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
part.Color = Color3.new(0, 1, 0.333333)
-- Saves a vector3 value
game.Players:GetPlayerFromCharacter(hit.Parent):SetAttribute("CurrentCheckpoint", part.Position)
print("Checkpoint Saved")
end
end)
end
Now its not doing anything i’ve tried doing print statements but its not printing anything also when I insert a part that and give it the tag it works as intended. Thanks for any help.