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: Teleport on click not working right...

Previous Thread :: Next Thread 
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
30 Nov 2011 06:36 AM
Why won't this work?

Output:19:40:59 - Players.huner2.PlayerGui.GunStart.Frame.Pistol.LocalScript:5: attempt to index global 'tel' (a nil value)
19:40:59 - Script "Players.huner2.PlayerGui.GunStart.Frame.Pistol.LocalScript", Line 5


player = game.Players.LocalPlayer
team = player.Character.Torso.Color
tel = Workspace.Map:findFirstChild("team")
function buy()
local telel = tel:getChildren()
local tele = telel[math.random(1, #telel)]
local positive = game.Workspace.Map:findFirstChild(telel)
local pos = positive.Positon
if Workspace.GameAlive.Value == 0 then
return end
player.Character.Torso.Positon = pos
end
script.Parent.MouseButton1Down:connect(buy)
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
30 Nov 2011 06:37 AM
Spelling fix
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
30 Nov 2011 06:42 AM
~Bump~
Don't Ignore the squishy :3
Report Abuse
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
30 Nov 2011 07:03 AM
player = game.Players.LocalPlayer
team = player.Character.Torso.Color
tel = game.Teams:FindFirstChild("Team")
function buy()
local telel = tel:getChildren()
local tele = telel[math.random(1, #telel)]
local positive = game.Workspace.Map:findFirstChild(telel)
local pos = positive.Positon
if Workspace.GameAlive.Value == 0 then
return end
player.Character.Torso.Positon = pos
end
script.Parent.MouseButton1Down:connect(buy)

and whats this in, i presume a localscript, but whats its parent?
Report Abuse
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
30 Nov 2011 07:09 AM
sorry, didn't read the script properly

player = game.Players.LocalPlayer
team = player.Character.Torso.BrickColor -- Color isn't a value on its own
tel = game.Workspace.Map:findFirstChild("team") -- it has to be game.Workspace
function buy()
local telel = tel:getChildren()
local tele = telel[math.random(1, #telel)]
local positive = game.Workspace.Map:findFirstChild(telel)
local pos = positive.Positon
if Workspace.GameAlive.Value == 0 then
return end
player.Character.Torso.Positon = pos
end
script.Parent.MouseButton1Down:connect(buy)
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
30 Nov 2011 07:11 AM
[ Content Deleted ]
Report Abuse
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
30 Nov 2011 07:33 AM
well i didn't know that, but that doesn't mean i can't script
Report Abuse
huner2 is not online. huner2
Joined: 27 Apr 2008
Total Posts: 1681
30 Nov 2011 05:01 PM
Uhh it still doesn't work and I'm getting the same output...
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