Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Error in ragdoll script. how do i fix this?

Asked by 9 years ago

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

Moderation edit: Make sure to use the Lua Code Block.
0
Have you even attempted to fix this? Warfaresh0t 414 — 9y
0
Yes, I've tried pegasus49 0 — 9y

Answer this question