fix() Runs exactly twenty-one times then quits. Any ideas?
(I already did a print debug, which determined everything up until then works)
repeat wait() until Workspace:FindFirstChild(Game.Players.LocalPlayer.Name)
local p=Instance.new("Part")
p.Transparency=1
p.Size=Vector3.new(2, 2, 2)
p.CanCollide=false print(3)
p.Parent=Game.Players.LocalPlayer.Character
local mouse=Game.Players.LocalPlayer:GetMouse()
local b = Instance.new('BodyGyro')
b.maxTorque = Vector3.new(math.huge, math.huge, math.huge) print(7)
b.cframe = mouse.hit
b.Parent = p
local active=false
i=1
function fix()
print(i)
i=i+1
if active==false then
active=true
p.CFrame=Game.Players.LocalPlayer.Character.Head.CFrame
p.CFrame=CFrame.Angles(0, math.rad(p.Rotation.Y), 0)
b.cframe=mouse.hit
active=false
end
end
p.Changed:connect(fix)
Game.Players.LocalPlayer.Character.Head.Changed:connect(fix)
mouse.Changed:connect(fix)

1 comment
Thank you! I'll go see if I can find a way to prevent that from happening...