I have a script to show first person arms, but for some reason, they disappear shortly after the character is spawned. It works perfectly fine in Studio, but on a local server, it starts to act strange.
repeat wait() until game.Players.LocalPlayer.Character
local name = script.Parent.Name
local character = game.Players.LocalPlayer.Character
local camera = workspace.CurrentCamera
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
character.r.Name = name.."r"
character.l.Name = name.."l"
character[name.."r"].Parent = workspace
character[name.."l"].Parent = workspace
game:GetService("RunService").RenderStepped:connect(function()
workspace[name.."r"].CFrame = CFrame.new(camera.CFrame * Vector3.new(1, -0.5, 0), camera.CFrame * Vector3.new(0, 0, 100))
workspace[name.."l"].CFrame = CFrame.new(camera.CFrame * Vector3.new(-1, -0.5, 0), camera.CFrame * Vector3.new(0, 0, 100))
end)

4 comments
anchored?
Shouldn't "workspace" be capitalized?
^ If it's "game.Workspace" then yes. Otherwise, workspace can be used by itself and it doesn't need to be capitalized.
Also, a problem with the script is that "repeat wait() until" doesn't always work when it comes to waiting for the character to load. Try using "wait(1)" instead.