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

My script is for a Loading Screen,can anyone tell why doesnt it work ?

Asked by 10 years ago
function PlayerAdded(np)
    sg = instance.new("ScreenGui",np.StarterGui)    
    fr = instance.new("Frame",sg)
    fr.Position = Udim2.new(0,0,0,0)
    fr.Active = false
    fr.BackgroundColor3 = Color3.new(8/255,121/255,207/255)
    fr.BackggroundTransperancy = 0
    fr.BorderPixel = 0
    fr.Name = "Loading"
    fr.Style = "RobloxRound"
    fr.Size = UDim2.new(1,1,1,1)
    fr2 = instance.new("Frame",sg)
    fr2.Position = UDim.new(0.5,0,0.4,0)
    fr2.Active = false
    fr2.BackgroundColor3 = Color3.new(207/255,13/255,55/255)
    fr2.BackgroundTransparency = 0
    fr2.BorderPixel = 0
    fr2.Name = "Loading Bar"
    fr2.Style = "RobloxSquare"
    fr2:TweenPosition(UDim2.new(0.2,0,0.4,0),"Out","Linear",5,false,nil)
    wait(5)
    sg:Destroy()

end
0
There are too many errors to even begin helping you. Learn how to debug your code, as juzz suggested. 2eggnog 981 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

Please do not ask other users to debug your code. Read this article on how to debug your code.

Also, on line two it shouldn't be StarterGui but PlayerGui. And you probably want to wait for it to be added too, but that's a different question.

Ad
Log in to vote
0
Answered by 10 years ago

I haven't read the code but I noticed there is not calling line.

If it still doesn't work try putting the GUI in PlayerGui instead of StarterGui.

Answer this question