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: Little help here...

Previous Thread :: Next Thread 
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
04 Feb 2014 02:32 AM
Well I am trying to make a wave script and I can't seem to get the teleport part working!

Mod = script.Parent

--------------------------------------------------------------
while true do
wait(2)
Mod.Message.Text = "Game starting in 3"
wait(1)
Mod.Message.Text = "Game starting in 2"
wait(1)
Mod.Message.Text = "Game starting in 1"
wait(1)
Mod.Message.Text = "Teleporting players..."
wait(1)
script.Parent.Parent.Character.Torso.CFrame = CFrame.new(1,1,1)
wait(0.01)
Mod.Message.Text = "Round 1"
wait(0.5)
Mod.Message.Text = ""
wait(1)
end




And yes there is a message thing.
Report Abuse
BlackBucketBoy is not online. BlackBucketBoy
Joined: 22 Jul 2011
Total Posts: 3230
04 Feb 2014 02:34 AM
Mhmm.

Where is the script located again?
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
04 Feb 2014 02:35 AM
In workspace.
Report Abuse
BlackBucketBoy is not online. BlackBucketBoy
Joined: 22 Jul 2011
Total Posts: 3230
04 Feb 2014 02:38 AM
If you are trying to teleport ALL the players, not just one, which your script indicates. I'm not even sure if it teleports a player. Use a for loop.

for _,v in pairs(game.Players:GetPlayers()) do
player.Character.Torso.CFrame = CFrame.new(1,1,1)
end

Your script errors because "script.Parent.Parent.Character.Torso.CFrame" is not ALL the players, I'm not even sure if it leads to the player or not.
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
04 Feb 2014 02:38 AM
Hello?
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
04 Feb 2014 02:39 AM
Oooooh....
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
04 Feb 2014 02:41 AM
Sooo...?



Mod = script.Parent

--------------------------------------------------------------
while true do
wait(2)
Mod.Message.Text = "Game starting in 3"
wait(1)
Mod.Message.Text = "Game starting in 2"
wait(1)
Mod.Message.Text = "Game starting in 1"
wait(1)
Mod.Message.Text = "Teleporting players..."
wait(1)
for _,v in pairs(game.Players:GetPlayers()) do
player.Character.Torso.CFrame = CFrame.new(1,1,1)
wait(0.01)
Mod.Message.Text = "Round 1"
wait(0.5)
Mod.Message.Text = ""
wait(1)
end
end
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
04 Feb 2014 02:44 AM
I looked in the output and it came up with this:

18:42:53.668 - Workspace.GameScript:20: attempt to index global 'player' (a nil value)
18:42:53.669 - Script 'Workspace.GameScript', Line 20
18:42:53.670 - stack end

And the message is stuck on Teleporting players...
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
04 Feb 2014 02:50 AM
Bump
Report Abuse
BlackBucketBoy is not online. BlackBucketBoy
Joined: 22 Jul 2011
Total Posts: 3230
04 Feb 2014 03:36 AM
Oh sorry, I made an error.

Here's the fixed part:

for _,v in pairs(game.Players:GetPlayers()) do
v.Character.Torso.CFrame = CFrame.new(1,1,1)
end
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
05 Feb 2014 02:13 AM
Ok? Thanks it works!

But how do I detect that if everyone died?

I want it that if everyone died, the game resets!
__________________________________________________________


Mod = script.Parent

--------------------------------------------------------------
while true do
wait(2)
Mod.Message.Text = "Welcome to AI Survival."
wait(2)
Mod.Message.Text = "Thank you for coming. New game will start soon!..."
wait(4.1)
Mod.Message.Text = "New Game starting in 3"
wait(1)
Mod.Message.Text = "Game starting in 2"
wait(1)
Mod.Message.Text = "Game starting in 1"
wait(1)
Mod.Message.Text = "Teleporting players..."
wait(1)
for _,v in pairs(game.Players:GetPlayers()) do
v.Character.Torso.CFrame = CFrame.new(1,1,1)
wait(1)
Mod.Message.Text = "Round 1"
wait(2)
Mod.Message.Text = ""
wait(1)
game.Lighting["Wave1"]:Clone().Parent = game.Workspace
wait(1)
h = Instance.new("Hint",game.Workspace)
h.Text = "Wave 1"
wait(50)
h.Text = "Wave 1 Completed!"
wait(2)
h.Text = "Wave 2"
Mod.Message.Text = "Wave 2, BEGIN!"
wait(1)
game.Lighting["Wave2"]:Clone().Parent = game.Workspace
wait(1)
Mod.Message.Text = ""
wait(50)
end
end
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
05 Feb 2014 02:23 AM
while wait(2) do
Mod.Message.Text = "Game starting in 3"
wait(1)
Mod.Message.Text = "Game starting in 2"
wait(1)
Mod.Message.Text = "Game starting in 1"
wait(1)
Mod.Message.Text = "Teleporting players..."
wait(1)
for i,v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = CFrame.new(1,1,1)
wait(1)
Mod.Message.Text = "Round 1"
wait(0.5)
Mod.Message.Text = ""
wait(1)
end
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
05 Feb 2014 02:23 AM
^^I got ninjad ._.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
05 Feb 2014 02:55 AM
"I got ninja'd"
Two hour difference between your post and his
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
05 Feb 2014 03:11 AM
Sooo... Still.... Any help?
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
05 Feb 2014 04:56 AM
Bumpity Bump.
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
05 Feb 2014 05:04 AM
for i, k in pairs(game.Players:GetPlayers()) do
repeat wait() until k.Character.Humanoid.Health<=0
--chunk of code here
end
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
05 Feb 2014 05:15 AM
Can you try copying my whole code and pasting your help? I don't know where to place that part, I tried to paste it before "while true do" but it just makes errors. Then I did it after still made errors.
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
05 Feb 2014 05:18 AM
I don't know where you want it, so I'll just explain line by line, and leave you to that decision.

for i, k in pairs(game.Players:GetPlayers()) do --get all the players
repeat wait() until k.Character.Humanoid.Health<=0 --repeat waiting until all players have died
--chunk of code here
end
Report Abuse
Solsticedev is not online. Solsticedev
Joined: 02 Feb 2014
Total Posts: 343
05 Feb 2014 06:48 AM
@wrecker try the Died event?
Report Abuse
LilJoker4675 is not online. LilJoker4675
Joined: 31 Oct 2011
Total Posts: 220
05 Feb 2014 06:55 AM
Mod = script.Parent

--------------------------------------------------------------
while true do
wait(2)
Mod.Message.Text = "Welcome to AI Survival."
wait(2)
Mod.Message.Text = "Thank you for coming. New game will start soon!..."
wait(4.1)
Mod.Message.Text = "New Game starting in 3"
wait(1)
Mod.Message.Text = "Game starting in 2"
wait(1)
Mod.Message.Text = "Game starting in 1"
wait(1)
Mod.Message.Text = "Teleporting players..."
wait(1)
for _,v in pairs(game.Players:GetPlayers()) do
v.Character.Torso.CFrame = CFrame.new(1,1,1)
wait(1)
Mod.Message.Text = "Round 1"
wait(2)
Mod.Message.Text = ""
wait(1)
game.Lighting["Wave1"]:Clone().Parent = game.Workspace
wait(1)
h = Instance.new("Hint",game.Workspace)
h.Text = "Wave 1"
wait(50)
h.Text = "Wave 1 Completed!"
wait(2)
h.Text = "Wave 2"
Mod.Message.Text = "Wave 2, BEGIN!"
wait(1)
game.Lighting["Wave2"]:Clone().Parent = game.Workspace
wait(1)
Mod.Message.Text = ""
wait(50)
k = (game.Players.GetPlayers())
k.Character.Health = 0 then
k.CFrame(-1,-1,-1)
end
end
Report Abuse
Truste135 is not online. Truste135
Joined: 26 Oct 2010
Total Posts: 741
05 Feb 2014 07:00 AM
Fixing Lil's script:

Mod = script.Parent

--------------------------------------------------------------
while true do
wait(2)
Mod.Message.Text = "Welcome to AI Survival."
wait(2)
Mod.Message.Text = "Thank you for coming. New game will start soon!..."
wait(4.1)
Mod.Message.Text = "New Game starting in 3"
wait(1)
Mod.Message.Text = "Game starting in 2"
wait(1)
Mod.Message.Text = "Game starting in 1"
wait(1)
Mod.Message.Text = "Teleporting players..."
wait(1)
for _,v in pairs(game.Players:GetPlayers()) do
v.Character.Torso.CFrame = CFrame.new(1,1,1)
wait(1)
Mod.Message.Text = "Round 1"
wait(2)
Mod.Message.Text = ""
wait(1)
game.Lighting["Wave1"]:Clone().Parent = game.Workspace
wait(1)
h = Instance.new("Hint",game.Workspace)
h.Text = "Wave 1"
wait(50)
h.Text = "Wave 1 Completed!"
wait(2)
h.Text = "Wave 2"
Mod.Message.Text = "Wave 2, BEGIN!"
wait(1)
game.Lighting["Wave2"]:Clone().Parent = game.Workspace
wait(1)
Mod.Message.Text = ""
wait(50)
k = (game.Players.GetPlayers())
if k.Character.Health == 0 then
k.CFrame(-1,-1,-1)
end
end

i'm not crazy just ask my toaster
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
06 Feb 2014 12:16 AM
I want the game reseting not teleport the player on death!
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
07 Feb 2014 02:20 AM
And again... No-one is going to help!
Report Abuse
HunterLX1BontyHunter is not online. HunterLX1BontyHunter
Joined: 23 Dec 2012
Total Posts: 793
07 Feb 2014 03:03 AM
Pew Pew Pew, Hurry up and help meh!
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