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 » Scripters
Home Search
 

Re: Gamepass tpin

Previous Thread :: Next Thread 
iiSqueze is not online. iiSqueze
Joined: 28 May 2015
Total Posts: 31
25 Jun 2015 09:10 PM
local GamePassService = game:GetService('GamePassService')
local GamePassId = 0000000000
local player = game.Players <<<<<<<<<






script.Parent.touched:connect(function(player)
player.Torso.CFrame = game.Workspace.Tp.CFrame <<<<<<<<<
print("hi")
if GamePassService:PlayerHasPass(player, GamePassId) then

end
end)



So right now Im just trying to TP the player, the two questions I have are. What is the player call in a script(Local script is game.Player.LocalPlayer) and what is wrong with this script.......
Report Abuse
KlinkStudios is not online. KlinkStudios
Joined: 31 Oct 2013
Total Posts: 563
25 Jun 2015 09:12 PM
1. game.Players.PlayerAdded:connect(function(player)
--player is the "local" player.
end)

2. This will help if by "TP" you mean teleport http://wiki.roblox.com/index.php?title=Teleportation

u sicko!
Report Abuse
iiSqueze is not online. iiSqueze
Joined: 28 May 2015
Total Posts: 31
25 Jun 2015 09:13 PM
Most of the wiki content is out of date.
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
25 Jun 2015 09:15 PM
1.) Learn English
2.) Your code is formatted in a confusing way
3.) It doesn't work that way.
4.) It's ".Touched" with a capital T
5.) .Touched event registers what part touched it, not which player
6.) Use game.Players:GetPlayerFromCharacter()
7.) Use :MoveTo() for teleporting players
Report Abuse
iiSqueze is not online. iiSqueze
Joined: 28 May 2015
Total Posts: 31
25 Jun 2015 09:15 PM
1. game.Players.PlayerAdded:connect(function(player)
--player is the "local" player.
end)

2. This will help if by "TP" you mean teleport http://wiki.roblox.com/index.php?title=Teleportation




///////////////////////////////////////////


Didn't help. Anyone else have a better explanation?
Report Abuse
Ictis is not online. Ictis
Joined: 01 Sep 2011
Total Posts: 1216
25 Jun 2015 09:15 PM
Most of the wiki content is literally copy/pasted from the object browser. So if it's not up to date blame the devs.
Report Abuse
iiSqueze is not online. iiSqueze
Joined: 28 May 2015
Total Posts: 31
25 Jun 2015 09:17 PM
.... Most of it was updated a while back.
Report Abuse
KlinkStudios is not online. KlinkStudios
Joined: 31 Oct 2013
Total Posts: 563
25 Jun 2015 09:18 PM
"Most of the wiki content is out of date."
".... Most of it was updated a while back."
You sir, are confusing.

u sicko!
Report Abuse
iiSqueze is not online. iiSqueze
Joined: 28 May 2015
Total Posts: 31
25 Jun 2015 09:20 PM
Out of date, a while back, Its pretty obvious what I mean
Report Abuse
iiSqueze is not online. iiSqueze
Joined: 28 May 2015
Total Posts: 31
25 Jun 2015 09:20 PM
And yes I have tried the Wiki stuff
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
25 Jun 2015 09:21 PM
In the original post, you used script.Parent.Touched, now you're using game.Players.PlayerAdded. MAKE UP YOUR MIND!!!!
Report Abuse
iiSqueze is not online. iiSqueze
Joined: 28 May 2015
Total Posts: 31
25 Jun 2015 09:24 PM
.... Phew....



Since most of you don't read the forum let me explain down here for the people who skip it.




I need to make a simple touch Tp. And Id like to know what is the player call for scripts(Local scripts is game.Player.LocalPlayer.)




Thank you anyone who can answer without just posting for no reason
Report Abuse
KlinkStudios is not online. KlinkStudios
Joined: 31 Oct 2013
Total Posts: 563
25 Jun 2015 09:25 PM
Put this in a normal script inside of the part:

local GamePassService = game:GetService('GamePassService')
local GamePassId = 0000000000

script.Parent.touched:connect(function(player)
player.Character.Torso.CFrame = CFrame.new(Vector3.new(Position))
print("hi")
if GamePassService:PlayerHasPass(player, GamePassId) then

end
end)

u sicko!
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
25 Jun 2015 09:26 PM
There is no "LocalPlayer" with server scripts, you have to find a reference. For instance, if it's in PlayerGui, the parent of PlayerGui is the player. If it's a .Touched event, use game.Player:GetPlayerFromCharacter(), etc. You need to find a reference.
Report Abuse
KlinkStudios is not online. KlinkStudios
Joined: 31 Oct 2013
Total Posts: 563
25 Jun 2015 09:26 PM
I'm sorry use this:

local GamePassService = game:GetService('GamePassService')
local GamePassId = 0000000000

script.Parent.touched:connect(function(player)
local Player = player:GetPlayerFromCharacter()
Player.Character.Torso.CFrame = CFrame.new(Vector3.new(Position))
print("hi")
if GamePassService:PlayerHasPass(player, GamePassId) then
--Why is this even here?
end
end)

u sicko!
Report Abuse
Wreckerbuster67 is not online. Wreckerbuster67
Joined: 29 Jul 2012
Total Posts: 1144
25 Jun 2015 09:27 PM
@Klink that won't work. Also, for the second time, it's .Touched... As I said, you need to find a reference. In .Touched events, it's game.Players:GetPlayerFromCharacter(part.Parent).
Report Abuse
KlinkStudios is not online. KlinkStudios
Joined: 31 Oct 2013
Total Posts: 563
25 Jun 2015 09:31 PM
Ugh just do this (sorry if I have been ninja'd)

function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then -- if a humanoid exists, then
local p = game.Workspace:FindFirstChild(part.Parent.Name)
if p ~=nil then
--Code
end
end
end

script.Parent.Touched:connect(onTouch)



u sicko!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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