I have a tycoon set up using LinkedLeaderboard script version 5.00 . When you get extra cash from the giver it will not work to purchase items in the tycoon. How would I link the scrips together so that they work?
I need to link my extra cash giver to the tycoon leaderboard. When I touch the giver I get the points. But when I go to purchase something with them they dont work. Im using the same label ("cash") on the giver script, the purchase handler script and the leaderborad. Why wont the money sync together?
If the LeaderBoard is working then try this: A shop type thing.
local debounce = false local price = 5 --How much cash it costs script.Parent.Touched:connect(function(part) local plyr = game:GetPlayerFromCharacter(part.Parent) local stat = plyr:FindFirstChild("leaderstats") local cash = stat:FindFirstChild("Cash") if not debounce and plyr and stat and cash and cash.Value >= price then debounce = true cash.Value = stat.Cash.Value-price --Add something here, It's the thing they bought. script.Parent:Destroy() wait(5) --Delay debounce = false end end)
local debounce = false local reward = 1000 --How much cash you get script.Parent.Touched:connect(function(part) local plyr = game:GetPlayerFromCharacter(part.Parent) local stat = plyr:FindFirstChild("leaderstats") local cash = stat:FindFirstChild("Cash") if not debounce and plyr and stat and cash then debounce = true cash.Value = stat.Cash.Value+reward wait(5) --Delay debounce = false end end)
If It doesn't show "Cash" in the leader stats do this.
--Kills leaderstats above. local Cash = Instance.new("IntValue", stat) --Is it stat or stats? Please change Cash.Name = "Cash" Cash.Value = 0
You were too vague, sorry If I didn't do what you wanted.
This may help you, but you should be using this method to stop hacking/exploits
All leader board information cannot be accessed or changed from the client (the local player) otherwise this would mean that players can hack your game. Instead all of the leader board information is kept on the server where it is safe.
To change the value on the server you will need to use a remote function which will then change the value on the server.
To test this you need to run roblox studio and go to the test menu and start a server with a player. Check that both value on the server and client match.
Also have a look at filtering it may help explain Filtering