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: How to fight for cash

Previous Thread :: Next Thread 
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
25 Oct 2017 11:23 AM
Fight script and cash // I can provide with leaderstats script
-------------------------------------------------------
function join(player)

if not (player or game.Players:WaitForChild(player,.1)) then
repeat wait(.1); warn("player not found!") until player end

local cash = player.leaderstats.Cash

for reward = 0, game.Players.NumPlayer, 20 do
cash.Value = cash.Value + reward
cash.Changed:Connect(function() cash.Value = cash.Value + reward end
end

return function(name) if name == player[name] then return true end end
end


function kill(obj)

if obj.Name == game.Players:WaitForChild("LocalPlayer").Name and (obj:FindFirstChild("Humanoid",true) or obj.Parent:IsAncestorOf("Humanoid")) then

local humanoid = obj.Parent.Humanoid --or obj.Hum... is filtered out
local safety = join()

humanoid.Died:Connect(function()
game.Players.PlayerAdded:Connect(join) end)

else repeat wait() until humanoid and safety end

return true end


if assert(game.Workspace.ChildAdded:wait(),"error: failed request")
game.Workspace.ChildAdded:Connect(kill) end
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
25 Oct 2017 11:24 AM
ok
Report Abuse
22618709 is not online. 22618709
Joined: 25 Dec 2011
Total Posts: 19221
25 Oct 2017 11:25 AM
ok


Report Abuse
ScripterForumHelper is not online. ScripterForumHelper
Joined: 09 Oct 2017
Total Posts: 70
25 Oct 2017 11:29 AM
ok


Report Abuse
GodShowsTheWay is not online. GodShowsTheWay
Joined: 27 Oct 2014
Total Posts: 7180
25 Oct 2017 12:11 PM
‍‍‍‍‍‍
Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
25 Oct 2017 12:27 PM
------------------------late response was eating pizza----------------------

federalReserve = {

bank = Instance.new("Folder"),
money = Instance.new("IntValue"),


security = function()
local agency = {}

for asset,type in pairs(federalReserve) do
agency[asset] = type end

return agency end,


translate = function(logX,logY,logZ)
logX.money.Value = logX.money.Value + math.abs(logY.NumPlayer%logZ) end
}

transport = federalReserve.security()


function comms(government)
if not government then repeat warn("government body missing") until government end
local state, currency = transport.bank, transport.money

state.Name = "leaderstats"; state.Parent = government
currency.Name = "Cash"; currency.Parent = state

return transport.translate(transport,game.Players,government) end


game.Players.PlayerAdded:Connect(comms)
Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
25 Oct 2017 01:10 PM
The issue is, sorry for not making it clear before, the data stored in IntValue is not persistent beyond client application.
I made a script which backsup userdata to a Roblox backend server. It is commonly referred to as, Data Store, and for the sake of simplicity please help me find a solution to solve this problem.

If you would like to see this script please do let me know in advance. ^_^
Report Abuse
Reece_plays is not online. Reece_plays
Joined: 14 Oct 2016
Total Posts: 492
25 Oct 2017 02:41 PM
ok


Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
25 Oct 2017 07:24 PM
ok?
--------------------------------------
local repStorage,notify = game:GetService("ReplicatedStorage"), Instance.new("RemoteEvent")
notify.Name = "Notify"
notify.Parent = repStorage

function leave(player)

playerId,cash = tostring(player.UserId), player.leaderstats.Cash
cashStore = game:GetService("DataStoreService"):GetDataStore("CashStore",playerId)

local test,money = pcall(function() return cash Store:SetAsync(cash,cash.Value) end)
if test then
cash.Value = cash.Value
else notify:FireClient(player.Name, "error: failed to save, try again later") end

end

function join(player)
if player then

local test, money = pcall(function() return cashStore:GetAsyc(cash) end)
if test then
cash.Value = cash.Value
else notify:FireClient(player.Name, "error: failed to load, try again later") end

else game.Players:WaitForChild("LocalPlayer") end
return game.Players.PlayerRemoving:Connect(leave) end

game.Players.PlayerAdded:Connect(join)
Report Abuse
nextgenplatform is not online. nextgenplatform
Joined: 27 Feb 2017
Total Posts: 797
25 Oct 2017 08:05 PM
function checksum(player)
if player and player.Character then
local cash,humanoid = player.leaderstats.Cash, player.Character.Humanoid

if cash.Value >= 30 then cash.Value = cash.Value - 30
humanoid.MaxHealth = humanoid.MaxHealth + 10

if humanoid:GetChangedPropertySignal(property) then
if property.Name == "MaxHealth" and cash.Changed:wait() then
humanoid.Health = humanoid.MaxHealth end end

else print("insufficient funds") end
else repeat game.Players:WaitForChild("LocalPlayer,1) until player.CharacterAdded:wait() end

return switch = true end)

game.Players.PlayerAdded:Connect(function(plyr)
switch = true
while wait() do if switch then
switch = false
checksum(plyr) end end)
Report Abuse
Chrounum is not online. Chrounum
Joined: 04 Apr 2015
Total Posts: 2911
25 Oct 2017 08:50 PM
ok


when the meme so supreme you let out a scream... ^o^
Report Abuse
astroian10 is online. astroian10
Joined: 26 Jun 2013
Total Posts: 153
25 Oct 2017 09:06 PM
ok
Report Abuse
D3D9 is not online. D3D9
Joined: 20 Aug 2016
Total Posts: 87
25 Oct 2017 09:08 PM
ok


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