In my game I've inserted this ragdoll script and it works in ROBLOX Studio, but whenever I publish the game and go on it the script doesn't work. How do I fix this?
local rs = game:GetService("RunService").RenderStepped local Player = game.Players.LocalPlayer local Character = Player.Character local camera = workspace.CurrentCamera local arms local function NewArms() local pleft = Character["Left Arm"]:Clone() local pright = Character["Right Arm"]:Clone() local lweld = Instance.new("Weld", pleft) local rweld = Instance.new("Weld", pright) "wait" lweld.Part0 = lweld.Parent rweld.Part0 = rweld.Parent lweld.Part1 = Character["Left Arm"] rweld.Part1 = Character["Right Arm"] local model = Instance.new("Model", camera) model.Name = "PseudoArms" pleft.Parent = model pright.Parent = model return model end arms = NewArms() while true do rs:wait() if (Character.Head.Position - camera.CoordinateFrame.p).magnitude < 2 then arms["Left Arm"].Transparency, arms["Right Arm"].Transparency = 0, 0 else arms["Left Arm"].Transparency, arms["Right Arm"].Transparency = 1, 1 end end