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

PlayerAdded script not working? (Updated)

Asked by
TrollD3 105
8 years ago

So Mad studio has an intro where something falls and destroys the M for each and every player and every time they enter. I made my own original version of this and I scripted it so that for every person that joins the game would see the intro . Its a script inside the workspace

--if I enter a wait  here (nothing works)

local FB = game.ReplicatedStorage.firstblack
local FG = game.ReplicatedStorage.firstgold
local SB = game.ReplicatedStorage.secondblack
local SG = game.ReplicatedStorage.secondgold
local TB = game.ReplicatedStorage.thirdblack
local TG = game.ReplicatedStorage.thirdgold
local Sound = game.ReplicatedStorage.Sound
local Sound2 = game.ReplicatedStorage.Sound2
local intro = game.ReplicatedStorage.introbuilding
local cam = game.Workspace.CurrentCamera

cam.CameraType = "Scriptable"

print("Check")
game.Players.PlayerAdded:connect(function(player)
    print("Check2")
    Sound:Clone()

print("Loading Part 1")
intro:Clone().Parent = cam
Sound2:Clone()
print("Loading Part 1.5")
FB:Clone().Parent = cam
FG:Clone().Parent = cam
SB:Clone().Parent = cam
SG:Clone().Parent = cam
TG:Clone().Parent = cam
TB:Clone().Parent = cam
print("Loading Part 2")


    print("Testing Intro with Player:" .. player.Name)
wait(1)
 -- The sounds cannot be in workspace becuase everyone would hear it ....
-- so do I clone it to the Local player? 
Sound:Play()
wait(1)
print("Loading Part 3")

if SG.Transparency ==0 then 

        repeat
    wait(.10)
    Sound.Volume = Sound.Volume-.15
until
Sound.Volume == 0
        --- there isnt an end so Idk if this will break the script cause Sound2 cant play yet...
---Possible error?
print("Loading Part 4")
Sound2:Play()
Sound2.Looped = true -- the end.




end
    end)






1 answer

Log in to vote
0
Answered by 8 years ago

Your problem is that you're using a localscript in startergui, while using childadded. Use the same script in a normal script in Workspace.

Hope I helped.

Ad

Answer this question