|
| 25 Apr 2016 05:00 PM |
| What is the most efficient way to do this? |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 05:01 PM |
| what's the difference with FE or without? you can only save data on the server anyways |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 05:01 PM |
What?
If FE is in any way, shape, or form causing even the slightest problem or annoyance saving data, you're doing it client-side which you are not supposed to do no matter what. Otherwise it changes nothing.
|
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 05:02 PM |
@aggressive
"Note: Data stores can only be accessed from server scripts."
Maybe he's using scripts in PlayerGui and saving data there I'm going to guess.
|
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 05:03 PM |
| Well I am using data stores server sided. |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 05:07 PM |
| Although I am accessing a number value inside the players backpack. |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 05:12 PM |
So should I move that number value to server storage so it's not local?
How would I access it then? |
|
|
| Report Abuse |
|
|
IanVIII
|
  |
| Joined: 03 Apr 2016 |
| Total Posts: 535 |
|
|
| 25 Apr 2016 05:19 PM |
The same way you would normally use DS. The same way you would normally use FE. |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 25 Apr 2016 05:28 PM |
If you're using no FE move it to ServerStorage. If you're using FE it doesn't matter where you put it. It could be Backpack. Whenever a player changes something locally, it doesnt effect the server at all. But when the server changes it, It effects everythings. For example:
LocalScript in Backpack
local objectRemoved = workspace:WaitForChild("objectRemoved") -- A part
wait(5)
objectRemoved:Destroy() -- This wont even work but if a exploiter does it, it will only delete for him, however if a server does it, it affects everyone.
Script in ServerScriptService
local objectRemoved = workspace:WaitForChild("objectRemoved") -- A part
wait(5)
objectRemoved:Destroy() --Removes the object for all players
|
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 06:50 PM |
| eRan idk what I'm doing wrong then. |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
|
| 25 Apr 2016 06:53 PM |
| I am using data stores that work without fe but not with fe. |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 25 Apr 2016 06:55 PM |
Ok, well things that could cause it to break is if you're:
-Trying to access to player's PlayerGui (nothing in the PlayerGui shows for the Server) -Trying to access things too fast (use WaitForChild to fix this)
I don't know anything else, you're gonna need to be more specific. You could try looking at peaspod's DataStore tutorial, that's how I started learning about it.
|
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 07:00 PM |
| The only thing I am accessing in the server scripts is a number value in the local players backpack. |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Apr 2016 07:03 PM |
| So would I have to use remote events? |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Apr 2016 07:06 PM |
| Is there a tutorial for using data stores with fe? |
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 07:08 PM |
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial
just learn how to use remote events for all purposes |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 25 Apr 2016 07:17 PM |
ServerScripts don't need a Remote to access a player's Backpack (remember the example I gave).
However, if the LocalScript wanted to check the value then it would need to use a Remote
|
|
|
| Report Abuse |
|
|
|
| 25 Apr 2016 07:18 PM |
"ServerScripts don't need a Remote to access a player's Backpack (remember the example I gave)."
what example??? |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 25 Apr 2016 07:29 PM |
Well you don't technically need a Remote to just view the Value, but if you wanted to buy a Weapon from shot, you should use remotes because checking from local can easily cause exploiters to just change their cash. (In my example, if you check from server the exploiters cash wont change.)
Here's another example.
ScreenGui TextButton LocalScript --Code Below (not real code just a example)
local Cash = ...Backpack..Cash local Remote = -- 2lazywrite -- local AmountNeeded = 150
script.Parent.MouseButton1Click:connect(function() if AmountNeeded <= Cash then Remote:FireServer(Cash,AmountNeeded,WeaponName) end)
Script in ServerScriptService
local Remote = -- 2lazywrite --
Remote.OnServerEvent:connect(function(player,Cash,ReqAmount,WeaponName) local newWeapon = ..WeaponContainer.WeaponName:Clone() newWeapon.Parent = player.Backpack end)
^ --Easy exploit. The exploiter can just send a fake cash like 9999 and a fake Amount like 2. This is something you can do to prevent that:
local Cash = ...Backpack..Cash local Remote = -- 2lazywrite --
script.Parent.MouseButton1Click:connect(function() Remote:FireServer(WeaponName) end)
Script in ServerScriptService
local Remote = -- 2lazywrite --
Remote.OnServerEvent:connect(function(player,WeaponName) local Weapon = ..WeaponContainer.WeaponName local Cash = player.Backpack..Cash local ReqAmount = Weapon.Amount --A NumberValue if ReqAmount <= Cash then local newWeapon = Weapon:Clone() newWeapon.Parent = player.Backpack end end)
Now... let's look at what we actually fixed.
Well first, We are not getting any values beside the WeaponName from the Client. Which means the player could only change the WeaponName. But that would be the same as just clicking a different button for the weapon.
Secondly, We Checked ReqAmount and Cash from server. GREATLY needed because if the exploiter has 50 cash and changes its cash to 500 it wont change for the server and we will still 50 cash.
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 25 Apr 2016 07:31 PM |
I posted a example earlier in the thread. That post was for strong though
|
|
|
| Report Abuse |
|
|
|
| 26 Apr 2016 05:17 PM |
| So my method should be working why is it not then? |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 26 Apr 2016 05:22 PM |
Idk, I don't even know your code xD
|
|
|
| Report Abuse |
|
|