Error in ragdoll script. how do i fix this?
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?
01 | local rs = game:GetService( "RunService" ).RenderStepped |
02 | local Player = game.Players.LocalPlayer |
03 | local Character = Player.Character |
04 | local camera = workspace.CurrentCamera |
07 | local function NewArms() |
08 | local pleft = Character [ "Left Arm" ] :Clone() |
09 | local pright = Character [ "Right Arm" ] :Clone() |
10 | local lweld = Instance.new( "Weld" , pleft) |
11 | local rweld = Instance.new( "Weld" , pright) "wait" |
12 | lweld.Part 0 = lweld.Parent |
13 | rweld.Part 0 = rweld.Parent |
14 | lweld.Part 1 = Character [ "Left Arm" ] |
15 | rweld.Part 1 = Character [ "Right Arm" ] |
16 | local model = Instance.new( "Model" , camera) |
17 | model.Name = "PseudoArms" |
27 | if (Character.Head.Position - camera.CoordinateFrame.p).magnitude < 2 then |
28 | arms [ "Left Arm" ] .Transparency, arms [ "Right Arm" ] .Transparency = 0 , 0 |
30 | arms [ "Left Arm" ] .Transparency, arms [ "Right Arm" ] .Transparency = 1 , 1 |
Moderation edit: Make sure to use the Lua Code Block.