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
 

Why won't this work??? (variables)

Previous Thread :: Next Thread 
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
06 Jan 2014 06:22 PM
local mapDirectory = game.Lighting.Maps
local msg = Instance.new("Message")
msg.Parent = game.Lighting
local maptime = 5

while true do
wait(0.5)
local maps = mapDirectory:getChildren()

if #maps == 0 then
print("Maps not found! Selfremoving...")
script:remove()
return
end

if script.Parent.Water.Tsunamis.FirstWC.Position.Z > 1500 then
local pickedMap = maps[math.random(1, #maps)]
local pickedMapClone = pickedMap:clone()
for number,player in pairs (game.Players:GetPlayers()) do
local char = player.Character
if char.Head.Position.Y < 434 and char.Humanoid.Health > 0 then
local name = player.Name
end
end
msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "Survivors: " ..name.."."
script.Parent.ScorePart.CanCollide = true
wait(1.5)
script.Parent.ScorePart.CanCollide = false
wait(1.5)
msg.Text = "Map is being changed!"
wait(5)
msg.Text = "Map chosen is: " ..pickedMapClone.Name.."."
print("Map inserted: " .. pickedMap.Name)
pickedMapClone.Parent = game.Workspace
pickedMapClone:makeJoints()
wait(5)
msg.Text = "Good Luck!"
wait(3)
msg.Text = "Survival In Progress..."
msg.Parent = game.Lighting
wait(3)
repeat
wait(0.5)
if script.Parent.Water.Tsunamis.FirstWC.Position.Z > 1500 then
pickedMapClone:remove()
end
until script.Parent.Water.Tsunamis.FirstWC.Position.Z > 1500
end
end

It works without the player stuff
I just want it to work with the player stuff and the name variable
Tell me whats wrong
Report Abuse
Drybones3363 is not online. Drybones3363
Joined: 16 Aug 2013
Total Posts: 1547
06 Jan 2014 06:42 PM
uh... 18 min. bump?
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