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 » Scripters
Home Search
 

Re: Weapons Lost When Teleporting To NEW PLACE ... Please Help

Previous Thread :: Next Thread 
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
29 Aug 2017 02:47 PM
So whenever I teleport fro my lobby (Original place to get weapons) and I go to my main game I lose all weapons that are in my possession/backpack.

Both the lobby and main game are in the same universe. Is thee anyway to keep the weapons when teleporting. Thanks in advance for any help.
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
29 Aug 2017 02:59 PM
If anyone is willing to help me and can create a Donation tshirt I will give you 150 robux for the help. I really need to figure this out
Report Abuse
yhatayhatahoohoo is not online. yhatayhatahoohoo
Joined: 19 Jan 2011
Total Posts: 1988
29 Aug 2017 03:06 PM
150 robux is boring, just have them receive the weapons on enter


print("print()")
Report Abuse
Protori is online. Protori
Joined: 22 Feb 2014
Total Posts: 253
29 Aug 2017 03:08 PM
Use data stores that save the weapon the player had right before he enters the other place, then retrieve the data on entry of the other place.


www.youtube.com/protori
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
29 Aug 2017 03:44 PM
I'm really trying to figure out the whole datastore thing. I don't need anyone to write the whole code but can someone point me in the right direction. Is there a prewritten script or somewhere I can go to figure it out? I really need to get this obstacle dealt with so any help is appreciated.
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
29 Aug 2017 05:06 PM
Anyone? I would really appreciate it. I really am trying to fix this today
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
30 Aug 2017 01:47 AM
does anyone have an idea on ow to do this?
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
30 Aug 2017 07:30 AM
okay what about 300 robux? Come on fellas (and ladies). Someone please help me out with this. I have gotten no futher since yesterday.
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
30 Aug 2017 08:20 AM
Come on someone. Please help me. I really need to get this done.
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
30 Aug 2017 08:31 AM
How do I get them to receive it? Can you at least provide me with a starting point? I am not asking you to write an entire script for me but I cannot figure this out. I know this has to be something very common. There must be a script somewhere that works o some kind of tutorial on this. Please point me in the right direction. I have been working on my game for quite some time and really need this in order to finish it. I really thought that it would automatically pass players through with their weapons whe they teleport to a new place in the same universe. Obviously I was wrong
Report Abuse
Firehoaxx is not online. Firehoaxx
Joined: 24 Dec 2015
Total Posts: 950
30 Aug 2017 08:32 AM
I can help you and make the whole script for 500.
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
31 Aug 2017 03:38 AM
Is there anyone who can help me with this please?
Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
31 Aug 2017 04:25 AM
Save the weapons to dataStore by making a SetAsync request that has a table of the weapon names.

Then use GetAsync after they are teleported to the new place and use the table with the weapon names that GetAsync returned to get the weapons from wherever you stored them and parent them to the player's backpack.


Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
01 Sep 2017 08:17 AM
Hey Thanks,

I appreciate you help. Unfortunately I kinda needed to at least look at something in order to get started going down the right path.

BUT FORTUNATELY I DID!!!! :) I found a script and it really helped me I finally finished
Report Abuse
RoblotXRB is not online. RoblotXRB
Joined: 16 Nov 2014
Total Posts: 2068
01 Sep 2017 08:19 AM
wow ur username xdddddddd


Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
01 Sep 2017 08:55 AM
lmao. I promise I didn't copy yours lol. But you do ################# # ################# username if I do say so myself lol
Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
01 Sep 2017 08:56 AM
was trying to say you do have a cool username if I do say so myself. I have No idea why it was hashed out
Report Abuse
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
01 Sep 2017 09:21 AM
I can help you. :)

I'm assuming you're teleporting the player with TeleportService:Teleport(id, player), right?

What you need to do is take advantage of the argument called tpData seen on here: http://wiki.roblox.com/index.php?title=API:Class/TeleportService/Teleport
On this wiki page, you'll note that Teleport has 4 parameters, the third one of which is teleportData.

When you teleport the player, you need to get everything in their backpack, make a table of it, and pass that table in the data space.

local tpService = game:GetService("TeleportService")

function tpPlayerWithTools(player)
local tools = {}
for i,v in pairs(player.Backpack:GetChildren())
if v:IsA("Tool") then
table.insert(tools, v.Name)
end
end

tpService:Teleport(id, player, tools)
end

In the place you're teleporting to, you'll need 3 this, a local script in ReplicatedFirst, a remote event in ReplicatedFirst, and a script in ServerScriptService.

-- Local script
teleportService.LocalPlayerArrivedFromTeleport:connect(function(dumbGui, teleportData)
game.ReplicatedFirst:WaitForChild("RemoteEvent"):FireServer(teleportData)
end)

-- Server script
local re = game.ReplicatedStorage.RemoteEvent

local playerStuff = {}

game.Players.PlayerAdded:connect(function(player)

player.CharacterAdded:connect(function(char)
-- loop through the playerStuff[player.Name] table and add items from server storage to the backpack
end)
end)

re.OnServerEvent:connect(function(player, dataTable)
playerStuff[player.Name] = dataTable
end

That's the bare parts of it, obviously the tools still need to be given to the character, but you now have the tool names and I'll leave inserting the tools up to you.

NOTE - If your game is FE Off/ExperimentalMode then this is fine, but if your game is FE on then you'll need to do some fixes. This can be easily exploited and is not the proper way to program in a FE environment, this is just some sample code to get you started. If you are FE, you'll definitely want to consider DataStores, I don't know how quick they update, so you might have problems with getting old inventories on arrival, but that's your problem :P

Report Abuse
CrazyRoblots is not online. CrazyRoblots
Joined: 13 Mar 2017
Total Posts: 52
01 Sep 2017 12:47 PM
Thank you so much. Fortunately I found the solution which is similar to yours and I'm now working forward to finish this game. I am extremely grateful for the help though I really wish you would've been around yesterday (it would've saved me a lot of time). But again thank you I do appreciate the help
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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