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...

01local Player=game.Players.LocalPlayer
02local Char=Player.Character
03repeat wait() until Char
04local Torso=Char.Torso
05Instance.new("Model",Char).Name="Body"
06function Thread(f) coroutine.wrap(f)() end
07function 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
08local Joints={}
09game:GetService("RunService").RenderStepped:connect(function()
10    for i,v in pairs(Joints) do
11        v[2].CFrame=v[1].CFrame*v[3]
12    end
13end)
14function CreateJoint(Part1,Part2,CF) table.insert(Joints,{Part1,Part2,CF}) end
15wait(3.5)
View all 60 lines...

1 answer

Log in to vote
1
Answered by
tumadrina 179
10 years ago
1local Player=game.Players.LocalPlayer
2repeat wait() until Char
3local Char=Player.Character
4local 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