|
| 11 Feb 2017 01:47 AM |
send you to the wished game if the brick the script is located in is touched via game Id? Thanks, I can't script and I'm looking for it. -Searched Script Helpers, -Past forum posts -Forum and asked friends. nothing :c |
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 11 Feb 2017 01:50 AM |
try looking harder for those 3 lines or very simply read the examples off of wiki with thorough explanation on how it works
02-10-2017 11:26 PM wiki.roblox.com/index.php?title=API:Class/BasePart/Touched wiki.roblox.com/index.php?title=API:Class/TeleportService/Teleport |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2017 01:52 AM |
| I'm not lazy or stubborn but when I read those lines, I see nothing but jib jab. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2017 01:58 AM |
I tried, I put two together and it seemed to look okay and I tried in game, it didn't teleport me to the wanted game.
bump |
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
| |
|
|
| 11 Feb 2017 02:03 AM |
Workspace.Part.Touched:connect(function(otherPart) print(otherPart) end) game:GetService('TeleportService'):Teleport(647914792)
I put it as a script in a part, I step on it. nothing. |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Feb 2017 02:11 AM |
put it between the .Touched and end)
|
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 11 Feb 2017 02:13 AM |
touched is an event for baseparts, connect the event to the basepart you want, if the script is inside the basepart just get the it by doing script.Parent
script.Parent.Touched
inside the function youll need to get the player who touched it, you can use a function inside the Players service called "GetPlayerFromCharacter". the part that touched it could be anything so youll need to check if its a #haracter or not
script.Parent.Touched:connect(function(PartThatTouched) --the first parameter "partthattouched" is the part that touched script.Parent if PartThatTouched.Parent:FindFirstChild("Humanoid") then --checks if PartThatTouched.Parent (which would be the character model) has the humanoid. no character doesn't have a #umanoid so thats how we check if its a #haracter --so you know that the part that touched it is from # character now #################################################Players:GetPlayerFromCharacter(script.Parent), GameId) --the functions first argument is the player. we get the player from the function "GetPlayerFromCharacter" because the parent of the part that touched is the character. the functions name is self explanatory. the 2nd argument is the gameid which the player teleports to end end)
remember that teleportservice cannot be accessed with a localscript, therefor this has to be a server script |
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 11 Feb 2017 02:15 AM |
| lowkey roblox has a 2nd filter that doesnt go through preview mode nice |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2017 02:26 AM |
| I guess what I'm asking for is basically impossible to find, sigh. |
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
| |
|
| |
|
|
| 11 Feb 2017 02:51 AM |
| bump number 976890437634896 |
|
|
| Report Abuse |
|
|