|
| 22 Apr 2014 05:30 PM |
So, basically, this is the heirarchy.
Workspace -InfoComputer --Computer (Which is the Surface Gui) ---Frame ----Processor (The following script) ----ImageButton
The ImageButton is just a decal of the place I want to teleport to. Here is the script:
local f = script.Parent.ImageButton
f.MouseButton1Down:connect(function() local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:getService("TeleportService"):TeleportToPlaceInstance(152644021, player) end end)
|
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:35 PM |
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
hit isnt defined |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Apr 2014 05:38 PM |
Omg... I should've known that. .. |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:39 PM |
I get this in output still:
18:38:41.820 - Script 'Workspace.InfoComputer.Computer.Frame.Processor', Line 4 18:38:41.821 - stack end 18:38:41.821 - Disconnected event because of exception
Note, I'm in studio. Should I try in-game? |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:39 PM |
I like your idea
Make it so the teleporter is like an icon of your place pic or somethin |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:40 PM |
Yea try in game
Also remember that F9 is online output system |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:40 PM |
| Wow, really? I've always wanted one. o.O |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:41 PM |
| http://blog.roblox.com/2014/04/find-bugs-in-live-games-with-the-developer-console/?utm_source=rss&utm_medium=rss&utm_campaign=find-bugs-in-live-games-with-the-developer-console |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:44 PM |
Okay, now here's what I get.
Content failed because Not Found Workspace.InfoComputer.Computer.Frame.Processor:4: attempt to index local 'hit' (a number value) |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:45 PM |
Overall output is this:
Content failed because Not Found Workspace.InfoComputer.Computer.Frame.Processor:4: attempt to index local 'hit' (a number value) Script 'Workspace.InfoComputer.Computer.Frame.Processor', Line 4 stack end |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:48 PM |
| Oh, the argument of MouseButton1Down doesnt relate to player, oops lol |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Apr 2014 05:55 PM |
New/Current Script
local f = script.Parent.ImageButton
f.MouseButton1Down:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:getService("TeleportService"):TeleportToPlaceInstance(152644021, player) end end)
|
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 05:59 PM |
From the Wiki: "Note: SurfaceGuis must be descendants of PlayerGui in order to know the player who is interacting with it." You have to put the SurfaceGui in PlayerGui, and make a localscript, which sets the adornee to the part. Then you can change the player variable so it references the player (using the .Parent property to link back to the player). You also can't have the hit in the parenthesis of the function, as MouseButton1Down does not return anything.
Here's my siggy... Done. |
|
|
| Report Abuse |
|
|
| |
|