So I made a tool that whenever you click on It, a train from replicastorage will carry the player, destroying parts when It touches the train, however I found a problem, the train works normally, as well of the script but It appears that the train doesn't destroy the parts, however for some reason making the player noclip Into them
Script:
local tool = script.Parent
local Debounce = false
local WaitTime = 30
tool.Activated:Connect(function()
if not Debounce then
Debounce = true
tool.Parent.Humanoid.Jump = true
wait(0.1)
local Train = game.ReplicatedStorage.Train:Clone()
local Weld = Instance.new("Weld")
Train.Parent = game.Workspace
Weld.Parent = Train
Train.Position = tool.Parent.Torso.Position
Train.Orientation = tool.Parent.Torso.Orientation
Weld.Part0 = Train
Weld.Part1 = tool.Parent.Torso
Train.Touched:Connect(function(hit)
local humanoid = hit.Parent:WaitForChild("Humanoid")
if hit:IsA("BasePart") and not humanoid.Parent then
hit:Destroy()
end
end)
game:GetService("Debris"):AddItem(Train,20)
game:GetService("Debris"):AddItem(Weld,20)
wait(5)
Weld:Destroy()
wait(WaitTime)
Debounce = false
end
end)

4 comments
Is the script server-sided or client-sided? If it's client sided it won't work. Try using RemoteEvents and clone the train in the server.
And add a disabled script inside the train that makes it destroy parts. Then enable the script once you clone the train.
Its a server script
it might be cus of this local humanoid = hit.Parent:WaitForChild("Humanoid") your waiting for humanoid that might not even be inside of the part and if there is a hum it will also stil not work cus of the not humanoid.Parent which is the part