generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: ZOMG! Script Help

Previous Thread :: Next Thread 
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
03 Feb 2014 06:23 PM
How would a gamescript be created? I have a basic idea, this is what i have so far:(NOTE:it doesnt work, still working out kinks)

players = {}
assets = {143988441,144652453}

function choosemap()
asset = assets[math.random(1,#assets)]
return asset
end

function guiStart(plr,asset)
label = Instance.new("TextLabel",plr.PlayerGui.ScreenGui)
label.Size = UDim2.new(1,0,1,0)
label.Name = "Game"
label.BackgroundColor3 = Color3.new(0,0,0)
label.Font = "SourceSansBold"
label.TextColor3 = Color3.new(1,1,1)
label.FontSize = "Size48"
label.ZIndex = 3
for i = 1,5 do
label.Text = "Choosing map"
wait(.3)
label.Text = "Choosing map."
wait(.3)
label.Text = "Choosing map.."
wait(.3)
label.Text = "Choosing map..."
wait(.3)
end
map = game:GetService("InsertService"):LoadAsset(asset)
map.Name = "Map"
map.Parent = Workspace
map:MoveTo(Vector3.new(200,200,200))
label.Text = "Map Chosen:"..map.Name.." by "..map.Maker.Value..""
game.Lighting.OutdoorAmbient = Color3.new(map.Ambience.Value)
game.Lighting.FogColor = Color3.new(map.FogColor.Value)
game.Lighting.FogEnd = map.FogEnd.Value
game.Lighting:SetMinutesAfterMidnight(map.Time.Value)
--add gamemodes here
wait(2.8)
label:Destroy()
end

function countDown(plr)
for i = 120,0,-1 do
for i = 0,10 do
plr.PlayerGui.GameClock.Time.TextTransparency = i/10
wait(.05)
end
plr.PlayerGui.GameClock.Time.Text = i
for i = 10,0,-1 do
plr.PlayerGui.GameClock.Time.TextTransparency = i/10
wait(.05)
end
end
end

function divide()
for i,v in pairs(players) do
v.TeamColor = BrickColor.Red()
end
game.Teams:RebalanceTeams()
--[[a = true
for i,v in pairs(players) do
if a then
v.TeamColor = BrickColor.new("Bright red")
elseif not a then
v.TeamColor = BrickColor.new("Bright blue")
end
end]]--
end

function endGame(player,map)
map:Destroy()
if Workspace:FindFirstChild("Map") then
Workspace.Map:Destroy()
end
for i,v in pairs(players) do
v.Neutral = true
end
end

function start()
while wait() do
asset = choosemap()
for i,v in pairs(players) do
guiStart(v,asset)
end
divide()
for i,v in pairs(players) do
countDown(v)
end
for i,v in pairs(players) do
endGame(v,map)
end
end
end


game.Players.PlayerAdded:connect(function(player)
player:WaitForChild("PlayerGui")
table.insert(players,player)
end)

repeat
wait()

until #players > 1
start()
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
03 Feb 2014 06:47 PM
B
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
03 Feb 2014 06:56 PM
Looks fine. What do you want?
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
03 Feb 2014 07:05 PM
I was wondering if there is a better way to do it. I've seen people use bind able functions but I don't know too much about those
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
03 Feb 2014 07:10 PM
Idk
http://wiki.roblox.com/index.php?title=BindableFunction
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image