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 |
|
|
|
| 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
|
  |
| Joined: 28 May 2015 |
| Total Posts: 31 |
|
|
| 25 Jun 2015 09:13 PM |
| Most of the wiki content is out of date. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 28 May 2015 |
| Total Posts: 31 |
|
|
| 25 Jun 2015 09:17 PM |
| .... Most of it was updated a while back. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 28 May 2015 |
| Total Posts: 31 |
|
|
| 25 Jun 2015 09:20 PM |
| And yes I have tried the Wiki stuff |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|