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
 

How do I convert this to work with FE on?

Previous Thread :: Next Thread 
bryson467 is online. bryson467
Joined: 11 Jan 2013
Total Posts: 53
08 Aug 2017 05:28 PM

-- This is a script stored inside ServerScripts




local level = game:GetService("DataStoreService"):GetDataStore("Levels")
local xp = game:GetService("DataStoreService"):GetDataStore("XP")
local axp = game:GetService("DataStoreService"):GetDataStore("AXP") -- amount of XP Neededlocal FrameEvent = game.w######################nction savedata(dataname, playerid, value)
game:GetService("DataStoreService"):GetDataStore(dataname):SetAsync(playerid, value)

end



game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder")
leader.Name = "leaderstats"
leader.Parent = player
local levelz = Instance.new("IntValue")
levelz.Value = level:GetAsync(tostring(player.userId)) or 1
levelz.Name = "Level"
levelz.Parent = player:WaitForChild("leaderstats")
local xpz = Instance.new("NumberValue")
xpz.Value = xp:GetAsync(tostring(player.userId))
xpz.Name = "XP"
xpz.Parent = player
local xpn = Instance.new("IntValue")
xpn.Value = axp:GetAsync(tostring(player.userId)) or 700
xpn.Name = "XpNeeded"
xpn.Parent = player
xpz.Changed:connect(function()
if player:WaitForChild("XP").Value >= player:WaitForChild("XpNeeded").Value then
levelz.Value = levelz.Value + 1
xpn.Value = xpn.Value + 700 * 1.75
savedata("Levels",player.userId,levelz.Value)
savedata("XP",player.userId,xpz.Value)
savedata("AXP",player.userId,xpn.Value)
FrameEvent:FireClient(player)
else
savedata("Levels",player.userId,levelz.Value)
savedata("XP",player.userId,xpz.Value)
savedata("AXP",player.userId,xpn.Value)
end
end)
end)

game.Players.PlayerRemoving:connect(function(player)
savedata("Levels",player.userId,player.leaderstats.Level.Value)
savedata("EXP",player.userId.player.EXP.Value)
savedata("AXP",player.userId.player.XpNeeded.Value)
end)


Bryson467, Developer
Report Abuse
DesignerDavid is online. DesignerDavid
Joined: 18 Feb 2014
Total Posts: 8422
08 Aug 2017 05:31 PM
I don't think you would have to do anything other than store the script within the ServerScriptService. exploiters cannot reach that area. well...most.
Report Abuse
bryson467 is online. bryson467
Joined: 11 Jan 2013
Total Posts: 53
08 Aug 2017 05:33 PM
No I have a Main Script that has Local IntValues inside the player but since I have Filtering enabled turned on this script only works when I hit Test in studio.


Bryson467, Developer
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