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: Why won't this work?

Previous Thread :: Next Thread 
cxcharlie is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
02 Aug 2013 11:33 PM
wait(.1)
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("LightingInfo")
local stage = stats:WaitForChild("Stage")
local checkpoints = game.Workspace:WaitForChild("CC")
if checkpoints then
one = checkpoints:findFirstChild("1")
end

player.CharacterAdded:connect(function(thing)
wait(.1)
if thing.Name==player.Name then
areplayer = game.Players:GetPlayerFromCharacter(thing)
if areplayer~= nil then
if areplayer == player then
character = thing
while character == nil or character:findFirstChild("Torso") == nil or character.Humanoid.Health<0 do wait() end
if stage.Value == 1 or stage.Value == "1" then

print("character is here")
print("1")
local rand = {"Pos1","Pos2","Pos3"}
local randdy = rand[math.random(1,#rand)]
print(randdy)
if randdy == "Pos1" then
print("POS1")
character.Torso.CFrame = one.CFrame + Vector3.new(math.random(-3,3),3.333,math.random(-3,3))
wait(.09)
character.Torso.CFrame = one.CFrame + Vector3.new(math.random(-3,3),3.333,math.random(-3,3))
elseif randdy =="Pos2" then
print("POS2")
wait(.05)
character.Torso.CFrame = CFrame.new(78.979, 19.163, 53.171)+Vector3.new(math.random(-1,1),3.333,math.random(-1,1))
elseif randdy == "Pos3" then
print("POS3")
wait(.05)
character.Torso.CFrame = CFrame.new(76.753, 21.338, 59.531)+Vector3.new(math.random(-1,1),3.333,math.random(-1,1))
end--random

elseif stage.Value == 0 or stage.Value =="0" then
local rand = {"Pos1","Pos2","Pos3"}
local randdy = rand[math.random(1,#rand)]
if randdy == "Pos1" then
wait(.05)
character.Torso.CFrame = CFrame.New(13.939, 1.3, -6.817)+Vector3.new(math.random(-1,1),0,math.random(-1,1))
elseif randdy == "Pos2" then
wait(.05)
character.Torso.CFrame = CFrame.New(14.075, 1.3, -1.781)+Vector3.new(math.random(-1,1),0,math.random(-1,1))
elseif randdy == "Pos3" then
wait(.05)
character.Torso.CFrame = CFrame.New(13.899, 1.3, -12.394)+Vector3.new(math.random(-1,1),0,math.random(-1,1))
end--random
elseif stage.Value ~= 1 or 0 then
wait(.1)
print("not 1")
character.Torso.CFrame =checkpoints:findFirstChild(stage.Value).CFrame+Vector3.new(math.random(-2,2),1,math.random(-2,2))
end--stage is 1 ?
end--is right player?
end--is not nil?
end--same name?
end)--end function


Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
02 Aug 2013 11:34 PM
At least tell us where the error occurs. Or provide the output if there is any.
Report Abuse
cxcharlie is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
02 Aug 2013 11:43 PM
no output
Report Abuse
cxcharlie is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
02 Aug 2013 11:56 PM
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