pearman
|
  |
| Joined: 05 Jun 2009 |
| Total Posts: 1681 |
|
|
| 28 Jul 2013 12:29 PM |
local transitionSound = Instance.new("Sound", game.Workspace) transitionSound.Volume = 2 transitionSound.Pitch = 1 transitionSound.Name = "transitionSound" transitionSound.SoundId = "rbxasset://sounds/clickfast.wav"
local gameMusic = Instance.new("Sound", game.Workspace) gameMusic.Volume = 2 gameMusic.Pitch = 1 gameMusic.Name = "gameMusic" gameMusic.SoundId = "http://www.roblox.com/asset/?id=11231513" gameMusic.Looped = true
function Startup(player)
--[[ Create the GUI ]]--
MyGUI = Instance.new("ScreenGui", player.PlayerGui) MyGUI.Name = "StartupGUI"
--[[ Create our frame ]]--
MyFrame = Instance.new("Frame", MyGUI) MyFrame.Size = UDim2.new(0, 600, 0, 150) MyFrame.Position = UDim2.new(0.5, -291, 0.5, -328) MyFrame.Style = "RobloxRound" MyFrame.Active = true MyFrame.Draggable = true MyFrame.BackgroundColor3 = Color3.new(0,0,0)
--[[ Create our textlabel ]]--
MyTextLabel = Instance.new("TextLabel", MyFrame) MyTextLabel.Size = UDim2.new(1, 0, 1, 0) MyTextLabel.BackgroundTransparency = 1 -- invisible = 1 MyTextLabel.TextColor3 = Color3.new(1,1,1) MyTextLabel.TextScaled = true MyTextLabel.Font = "ArialBold" MyTextLabel.FontSize = "Size36" MyTextLabel.Text = "Welcome!"
if game.Workspace.IsStartup.Value == true then script.Parent.IsStartup.Value = false end end
function ChangeGui(player) while IsStartup == true do wait(2) end --[[ Tell the user information about the game ]]-- player.PlayerGui.StartupGUI.Frame.TextLabel.Text = "This game was made by pearman!" transitionSound:Play() wait(2) player.PlayerGui.StartupGUI.Frame.TextLabel.Text = "This project is currently top-secret!" transitionSound:Stop() transitionSound:Play() wait(2) transitionSound:Stop() transitionSound:Play() player.PlayerGui.StartupGUI.Frame.TextLabel.Text = "Welcome!" wait(2) transitionSound:Stop() end
function PlayGameMusic() --[[ Play music in the background for the game ]]-- if game.Workspace.IsMusicPlaying.Value == false then gameMusic:Play() game.Workspace.IsMusicPlaying.Value = true end end
game.Players.PlayerAdded:connect(Startup)
for i, v in pairs(game.Players:GetChildren()) do Startup(v) ChangeGui(v) PlayGameMusic() end
What's wrong with it that makes it not work in a regular server? |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2013 12:30 PM |
add
wait()
at the top of the script, before anything. |
|
|
| Report Abuse |
|
|
pearman
|
  |
| Joined: 05 Jun 2009 |
| Total Posts: 1681 |
|
|
| 28 Jul 2013 12:34 PM |
| Didn't work, but wait(10) did. The sounds got messed up though. Is there a way to make it so it will wait until everything loads properly? |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2013 12:35 PM |
When accessing an instance, do it like this:
Instead of this:
local something = script.Parent local somethingElse = something.blah
do this:
somethingElse = something:WaitForChild("blah")
That may help you.
Are you using this as a localscript, and where is it parented? |
|
|
| Report Abuse |
|
|
pearman
|
  |
| Joined: 05 Jun 2009 |
| Total Posts: 1681 |
|
|
| 28 Jul 2013 01:18 PM |
| I'm using it as a regular script in Workspace. |
|
|
| Report Abuse |
|
|
pearman
|
  |
| Joined: 05 Jun 2009 |
| Total Posts: 1681 |
|
|
| 28 Jul 2013 01:56 PM |
| Also, I used WaitForChild to make sure everything got loaded, but only the GUI showed up in public mode, nothing else happened. |
|
|
| Report Abuse |
|
|