My touched script doesnt always run for some reason. And i dont know why. Here's my script
local door = script.Parent
local donut = workspace.DonutRoom.DonutTeleport
local pizza = workspace.PizzaRoom.PizzaTeleport
local apple = workspace.MineshaftRoom.MineshaftTeleport
local billysays = game:GetService("ReplicatedStorage"):FindFirstChild("BillySays")
door.Touched:Connect(function(hit)
script.Disabled = true
if hit.Parent:FindFirstChild("Humanoid") then
local char = hit.Parent
for i = 1,1 do
local rndm = math.random(1,3)
if rndm == 1 then
char.HumanoidRootPart.Position = donut.Position
billysays.Value = "I want that DONUT!"
else
if rndm == 2 then
char.HumanoidRootPart.Position = pizza.Position
billysays.Value = "GET ME THE PIZZA! I WANT THE PIZZA!"
else
if rndm == 3 then
char.HumanoidRootPart.Position = apple.Position
billysays.Value = "I WANT THE APPLE! APPLE APPLE APPLE!"
end
end
end
end
end
end)
It runs sometimes. and sometimes it doesnt. Is this a studio glitch or a scripting error?

2 comments
Thank you!
Thank you!