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: Why isnt my textbutton teleporting players?

Previous Thread :: Next Thread 
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 10:57 AM
Okay i set up a main menu and since i new to the teleporting service, I wanted to try making a text button to teleport players to another lobby or in this case mutliplayer lobby. I looked for help on wiki and i used to this script...

---If we wanted to make a button that teleports a player to place id: 8473728 when they touch it we would make the following script a child of the button part.---

function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
game:GetService("TeleportService"):Teleport(8473728, player)
end
end

script.Parent.Touched:connect(onTouched)
---------------------------------------------------------
Is this for a button part or for a gui button i dont get it..
Report Abuse
ManMinded is not online. ManMinded
Joined: 07 Oct 2012
Total Posts: 618
24 Jun 2014 10:59 AM
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game.Players.WaitForChild("player")
game:GetService("TeleportService"):Teleport(8473728, player)
end

script.Parent.Touched:connect(onTouched)

??? Haven't worked much with waitforchild & teleportservices.. so, no idea if this will work.
Report Abuse
ManMinded is not online. ManMinded
Joined: 07 Oct 2012
Total Posts: 618
24 Jun 2014 11:02 AM
Actually,

function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game.Players:WaitForChild("player")
game:GetService("TeleportService"):Teleport(8473728, player)
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
24 Jun 2014 11:04 AM
deb = false

function onTouched(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) and not deb then
deb = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game:GetService("TeleportService"):Teleport(8473728, player)
deb = false
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
24 Jun 2014 11:05 AM
^It won't.. you didn't even concatenate the player value when trying to detect it in a string ._.


script.Parent.Touched:connect(function(hit)
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if (plr ~= nil) then
game:GetService('TeleportService'):Teleport(8473728,plr)
end end)
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
24 Jun 2014 11:06 AM
just use mine
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
24 Jun 2014 11:11 AM
Oh haha he wants it for a textbutton..

Put this inside the TextButton.

plr = script.Parent...[Parent it up to 1 outside the workspace]

script.Parent.MouseButton1Click:connect(function()
game:GetService('TeleportService'):Teleport(8473728,plr)
end)
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 11:14 AM
Ok imma try all of em lemme see
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
24 Jun 2014 11:20 AM
WAIT, if the last one with the .Clicked one doesn't work, do this.

script.Parent.MouseDetector.MouseClick:connect(function()
-- /\
--put a mouse detector in the button
--All the other "guts" of the script in here.
end)
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 11:28 AM
okay Goul i used urs and in Studio, Play solo it said the Teleporting players in studio is not allowed. So i was like okay yay im guessing it works.. But when i got to my game and i played it it didnt work in my game :/
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
24 Jun 2014 11:30 AM
...MouseDetector?
Where the hell did you hear you're supposed to use a MouseDetector? xD that's not even a thing
-=Robo=-
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 11:35 AM
Yeah when i used his this is what came up in output :/
MouseDetector is not a valid member of TextButton
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 12:03 PM
b1
Report Abuse
SpazzMan502 is not online. SpazzMan502
Joined: 01 Aug 2013
Total Posts: 2397
24 Jun 2014 12:03 PM
My nooby scripting this IS... I think he meant ClickDetector, so right click on textbox and click insert basic object and click on ClickDetector, and change his script instead of Mousedetecter but Scriptdetecter. ALSO You cant teleport ot inactive places UNLESS you have the place in a universe

Hope this helps
~Spazz
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 12:13 PM
Yeah that doesnt work either,
For 1 you cant insert a click detector inside of a gui object, and i never heard of the script detector before ever..
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 12:37 PM
b2
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
24 Jun 2014 12:50 PM
ughhh
go to pastebin and paste this after the link
/zTxuge71
-=Robo=-
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
24 Jun 2014 12:50 PM
piplup, what exactly do you want to do?
can you take a screenshot of your current set up, or explain to us in detail.
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
24 Jun 2014 12:56 PM
wait, is the main menu a gui or a series of buttons?
-=Robo=-
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
24 Jun 2014 12:58 PM
LOL, sorry ClickDetector. Im sorry. xD
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 12:59 PM
Omg, Okay im trying to make a menu Gui
In the menu Gui contains an image label with text buttons in it
I want the text buttons to be able to teleport me to another place in my universe
"The start place is Bullet FPS experience" But when i used you guys examples
They sort of worked in studio but not when im in playing my game from the website\

Heres what happens when i use this script
plr = script.Parent.Parent.Parent.Parent

script.Parent.MouseButton1Click:connect(function()
game:GetService('TeleportService'):Teleport(143510844,plr)---- Other place id
end)

It says in studio or testing "Teleporting while using Roblox Studio is not Permitted" So okay i guess it works
But When im trying to play my game from the website, Nothing happens when i click the button.. I need help with
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
24 Jun 2014 01:02 PM
I think you might need to specify WHO gets teleported. All you put is WHERE it teleports you not WHO it teleports.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
24 Jun 2014 01:02 PM
I think you might need to specify WHO gets teleported. All you put is WHERE it teleports you, not WHO it teleports.--Sorry bad grammar
Report Abuse
piplup572 is not online. piplup572
Joined: 09 Jul 2009
Total Posts: 411
24 Jun 2014 01:09 PM
So i put.. specificaly< --- Bad spelling i think, Teleport me to place id so and so or i use teleport all the children of players or what idk it kinda confusing
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
24 Jun 2014 01:44 PM
All your saying is
Ok script, get the service. Ok stop.
You need to specify who to teleport.
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