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

LocalScript not working in online mode?

Asked by
Muoshuu 580 Moderation Voter
10 years ago

It works in studio but not in online mode The LocalScript is inside the StarterGui object

and yes, I know it is messy...

local Player=game.Players.LocalPlayer
local Char=Player.Character
repeat wait() until Char
local Torso=Char.Torso
Instance.new("Model",Char).Name="Body"
function Thread(f) coroutine.wrap(f)() end
function CreatePart(Name,Color,Size,Parent) local Part=Instance.new("Part",Parent) Part.CanCollide=false Part.BrickColor=Color Part.Name=Name Part.TopSurface="Smooth" Part.BottomSurface="Smooth" Part.Material="SmoothPlastic" Part.FormFactor="Custom" Part.Size=Size return Part end
local Joints={}
game:GetService("RunService").RenderStepped:connect(function()
    for i,v in pairs(Joints) do
        v[2].CFrame=v[1].CFrame*v[3]
    end
end)
function CreateJoint(Part1,Part2,CF) table.insert(Joints,{Part1,Part2,CF}) end 
wait(3.5)
for i,v in pairs(Char:GetChildren()) do
    if v:IsA("Clothing") or v:IsA("Accoutrement") or v:IsA("CharacterAppearance") or v:IsA("BaseScript") then
        v:destroy()
    elseif v:IsA("BasePart") then
        v.Transparency=1
    end
end
Torso.roblox:destroy()
Char.Head.face:destroy()
Char.Humanoid.CameraOffset=Vector3.new(0,2,0)
local CF=Torso.CFrame
local NTS=Vector3.new(2.5,3,1)
local NewTorso=CreatePart("Torso",BrickColor.White(),NTS,Char.Body)
local TMesh=Instance.new("SpecialMesh",NewTorso)
TMesh.MeshId="rbxassetid://27111894"
TMesh.Scale=Vector3.new(1.5,1.5,1)
local T_Joint=CreateJoint(Torso,NewTorso,CFrame.new(0,2,0))
CF=NewTorso.CFrame
local Neck=CreatePart("Neck",BrickColor.Black(),Vector3.new(.5,.5,.5),Char.Body)
local N_Joint=CreateJoint(NewTorso,Neck,CFrame.new(0,1.75,0))
Instance.new("CylinderMesh",Neck)
local Head=CreatePart("Head",BrickColor.White(),Vector3.new(1,1,1),Char.Body)
local H_Joint=CreateJoint(Neck,Head,CFrame.new(0,.75,0))
Instance.new("SpecialMesh",Head).Scale=Vector3.new(1.5,1.5,1.5)
local face=Instance.new("Decal",Head)
face.Texture="http://www.roblox.com/asset/?id=54172037"
face.Face="Front"
local RightShoulder=CreatePart("RightShoulder",BrickColor.Black(),Vector3.new(1,1.1,1),Char.Body)
local RS_Joint=CreateJoint(NewTorso,RightShoulder,CFrame.new(-1.65,.9,0))
Instance.new("SpecialMesh",RightShoulder).MeshType="Sphere"
local LeftShoulder=CreatePart("LeftShoulder",BrickColor.Black(),Vector3.new(1,1.1,1),Char.Body)
local LS_Joint=CreateJoint(NewTorso,LeftShoulder,CFrame.new(1.65,.9,0))
Instance.new("SpecialMesh",LeftShoulder).MeshType="Sphere"
local RightBicep=CreatePart("RightBicep",BrickColor.White(),Vector3.new(.6,1.5,.6),Char.Body)
local RB_Joint=CreateJoint(RightShoulder,RightBicep,CFrame.new(0,-.75,0))
Instance.new("CylinderMesh",RightBicep)
local LeftBicep=CreatePart("LeftBicep",BrickColor.White(),Vector3.new(.6,1.5,.6),Char.Body)
local LB_Joint=CreateJoint(LeftShoulder,LeftBicep,CFrame.new(0,-.75,0))
Instance.new("CylinderMesh",LeftBicep)
local RightElbow=CreatePart("RightElbow",BrickColor.Black(),Vector3.new(.7,.7,.7),Char.Body)
local RE_Joint=CreateJoint(RightBicep,RightElbow,CFrame.new(0,-.58,0))
Instance.new("SpecialMesh",RightElbow).MeshType="Sphere"
local LeftElbow=CreatePart("LeftElbow",BrickColor.Black(),Vector3.new(.7,.7,.7),Char.Body)
local LE_Joint=CreateJoint(LeftBicep,LeftElbow,CFrame.new(0,-.58,0))
Instance.new("SpecialMesh",LeftElbow).MeshType="Sphere"

1 answer

Log in to vote
1
Answered by
tumadrina 179
10 years ago
local Player=game.Players.LocalPlayer
repeat wait() until Char
local Char=Player.Character
local Torso=Char.Torso

This might not be it, but I believe you're supposed to "repeat wait() until" before you assign it to Char because you need to have it before you use it.

0
Figured that out a little bit ago, but thanks anyway. Muoshuu 580 — 10y
Ad

Answer this question