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

Script works fine in studio but breaks in game with no error message. why?

Asked by 6 years ago

ok this has stumped me and i have no idea how to fix it. Its supposed to be a custom loading screen i designed for my game. and it works great. i go to test it in game(not in studio) it does nothing and no error message. help?

local prog = 0

script.Parent.Parent.Parent.Parent.PlayerAudio.IntroMusic:Play()
script.Parent.Parent.Parent.Parent.Parent.CameraMinZoomDistance = 10
local player = script.Parent.Parent.Parent.Parent.Parent.Name
workspace:WaitForChild(player).Humanoid.WalkSpeed = 0


while wait() do
    prog = prog + 0.5
    script.Parent.Size = UDim2.new(prog/100, 0, 0.1, 0)
    script.Parent.Parent.LoadingLabel.Text = ("Loading...   " ..math.floor(prog*2).. "%")
    if prog == 80 then
        wait(1)
        script.Parent.Parent.LoadingLabel.Text = "Loaded!"

        local A = script.Parent.Parent.LoadingLabel:Clone()
        A.Name = "LoadedLabel"
        A.Parent = script.Parent.Parent

        script.Parent.Parent.LoadingLabel.TextTransparency = 1


        script.Parent.Parent.Parent.Start:TweenPosition(UDim2.new(0.229, 0,0.051, 0),1,7,3)
    end
end
0
If you want to get the player you need game.Players.LocalPlayer instead of script.Parent.Parent.Parent.Parent RootEntry 111 — 6y
1
First of all, is the game filtering enabled? Second, is this a script or local script? Despayr 505 — 6y
0
Try removing lines 3, 4 and 6 ADUPS 5 — 6y
0
my bad, i should of described more. This is a serverscript in a filtering enabled game. Lines 3,4 and 6 are used to help out the GUI. i may be able to remove 4 and 6, but 3 plays the music which would really ruin it. Creeper_Dude158 11 — 6y

Answer this question