|
| 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 |
|
|
|
| 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 |
|
|
|
| 29 Aug 2017 03:06 PM |
150 robux is boring, just have them receive the weapons on enter
print("print()") |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 29 Aug 2017 05:06 PM |
| Anyone? I would really appreciate it. I really am trying to fix this today |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2017 01:47 AM |
| does anyone have an idea on ow to do this? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 30 Aug 2017 08:20 AM |
| Come on someone. Please help me. I really need to get this done. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 31 Aug 2017 03:38 AM |
| Is there anyone who can help me with this please? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 16 Nov 2014 |
| Total Posts: 2068 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|