Xarkos
|
  |
| Joined: 15 Jul 2015 |
| Total Posts: 2210 |
|
|
| 20 Sep 2015 04:11 PM |
script.Parent.MouseButton1Click:connect(function() game:GetService("TeleportService"):Teleport(299047057, player) end
for some reason it's not working, can anyone help?
Patience is key 🔐 |
|
|
| Report Abuse |
|
|
Luxurize
|
  |
| Joined: 31 Mar 2015 |
| Total Posts: 1289 |
|
|
| 20 Sep 2015 04:13 PM |
And whom is 'Player'?
“Insane isn't always black or white. We're all pathological, in our own ways.” |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 20 Sep 2015 04:14 PM |
| Since you are using this in a gui, im assuming you are using a localscript, so you can use game.Players.LocalPlayer. If not, then make player = the directory that will lead you to the player. |
|
|
| Report Abuse |
|
|
Xarkos
|
  |
| Joined: 15 Jul 2015 |
| Total Posts: 2210 |
|
|
| 20 Sep 2015 04:16 PM |
function onClick(click) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if script.Parent.MouseButton1Click:connect(function() then game:GetService("TeleportService"):Teleport(299047057, player) end end
Patience is key 🔐 |
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 20 Sep 2015 04:17 PM |
| And what is "hit.Parent", more specifically, what is "hit"? |
|
|
| Report Abuse |
|
|
Xarkos
|
  |
| Joined: 15 Jul 2015 |
| Total Posts: 2210 |
|
|
| 20 Sep 2015 04:18 PM |
function onClick(click) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if script.Parent.MouseButton1Click:connect(function() then game:GetService("TeleportService"):Teleport(299047057, player) end end script.Parent.MouseButton1Click:connect(onClick)
i'm using a regular script
Patience is key 🔐 |
|
|
| Report Abuse |
|
|
Xarkos
|
  |
| Joined: 15 Jul 2015 |
| Total Posts: 2210 |
|
|
| 20 Sep 2015 04:20 PM |
oops sorry it was actually supposed to be click.Parent.
i was just browsing the wiki :P
function onClick(click) local player = game.Players:GetPlayerFromCharacter(click.Parent) if script.Parent.MouseButton1Click:connect(function() then game:GetService("TeleportService"):Teleport(299047057, player) end end
script.Parent.MouseButton1Click:connect(onClick)
Patience is key 🔐 |
|
|
| Report Abuse |
|
|