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 » Game Design
Home Search
 

Re: Help with Round System

Previous Thread :: Next Thread 
leomesa is online. leomesa
Joined: 11 Apr 2014
Total Posts: 1029
30 Jun 2016 08:33 PM
Hey I have a round system in which the game starts with Intermission and waits 15 seconds to begin then it sends them to the map. Once there at the map I want them to fight to climb to a certain brick and whoever reaches that brick first wins and then the game restarts back to the lobby. I am having trouble figuring out how to restart the game once the player touches that brick. I have a wait(10) placed in the section where I believe it will go just to test but i'll replace it with the touch event. This is a LocalScript by the way.

local tvalue = script.Parent.StatusTag

lastSpawnPointUsed = 0

lobbySpawn = game.Workspace.Lobby.SpawnLocation
Players = game.Players.LocalPlayer
StarterWeapon = game.ReplicatedStorage.Weapons.Starter.Pistol
TouchBrick = game.ReplicatedStorage.Maps.TheClassicFFA.MainLadders.LadderTop

function beginGame()
for i = 15, 0, -1 do
wait(1)
tvalue.Text = "Intermission: " .. i .. ""
if i == 0 then
tvalue.Text = "Game Started!"
local map = game.ReplicatedStorage.Maps.TheClassicFFA
map:Clone().Parent = game.Workspace
for i, player in ipairs(game.Players:GetChildren()) do
if player.Character ~= nil then
lastSpawnPointUsed = lastSpawnPointUsed + 1
player.Character:MoveTo(map.SpawnPoints:GetChildren()[lastSpawnPointUsed].Position)
end
StarterWeapon:Clone().Parent = Players.Backpack

wait(10) --Where the Touch event will go

tvalue.Text = "Game Over!"
for i, player in ipairs(game.Players:GetChildren()) do
if player.Character ~= nil then
lastSpawnPointUsed = lastSpawnPointUsed + 1
player.Character:MoveTo(lobbySpawn.Position)
end
Players.Character.Humanoid:UnequipTools()
Players.Backpack.Pistol:Destroy()
wait(2)
beginGame()
end

end
end
end --Ends
end

if game.Players.NumPlayers > 0 then
beginGame()
else
tvalue.Text = "Need 2 or more players to begin."
end

Report Abuse
leomesa is online. leomesa
Joined: 11 Apr 2014
Total Posts: 1029
30 Jun 2016 08:34 PM
bump
Report Abuse
leomesa is online. leomesa
Joined: 11 Apr 2014
Total Posts: 1029
30 Jun 2016 08:41 PM
bump again:P
Report Abuse
greenmaxy is online. greenmaxy
Joined: 15 Jun 2012
Total Posts: 330
30 Jun 2016 09:08 PM
Make a touch event in the brick. If you need more help just ask
Report Abuse
leomesa is online. leomesa
Joined: 11 Apr 2014
Total Posts: 1029
30 Jun 2016 09:14 PM
I could but i'm using a localscript so I won't be able to access the event.
Report Abuse
greenmaxy is online. greenmaxy
Joined: 15 Jun 2012
Total Posts: 330
30 Jun 2016 09:40 PM
Try making a variable (string) that changes when the player touches the brick (string is in map or something). It changes the value when touched (To the players name) Then do
local numberofplayers = game.Players:GetChildren()

for i = 1, #numberofplayers do
Then kill the players that don't have the name as the value


end


I didn't check it over...
Report Abuse
leomesa is online. leomesa
Joined: 11 Apr 2014
Total Posts: 1029
30 Jun 2016 09:41 PM
Alright I'll try that.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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