Hello again, I have a system currently that spawns in coins for the player to collect, but the problem is that I want to add systems like spawn frequency, spawn cap, things like that. And I can’t do that in its current state, as it spawns the coins for every player, at the same set frequency, and anyone can pick up the coins.
What I want is for each player to have their own unique set of coins, at their own unique frequency, and nobody else can see anyone’s coins but their own.
Any ideas on where to start? Server side scripting is brand new to me, and I know that just making it client side would be easier, but it would make it easy to cheat.
Currently, this is what we are working with.
local module = {}
-- Dropper Specific Variables --
local dropperPart = game.Workspace.GameFolders.Dropper:WaitForChild("MoneyDropper")
local moneyItem = game.Workspace.GameFolders.MoneyItems:WaitForChild("Money")
local df = dropperPart.DropFrequency.Value
local corner1 = dropperPart:WaitForChild("Corner1")
local corner2 = dropperPart:WaitForChild("Corner2")
local maxCoins = 20 -- Doing nothing with this right this second --
local X1 = corner1.Position.X
local X2 = corner2.Position.X
local Y1 = corner1.Position.Y
local Z1 = corner1.Position.Z
local Z2 = corner2.Position.Z
-- Dropper Function --
module.DropperScript = function()
local moneyPos = Vector3.new(math.random(X1, X2), dropperPart.Position.Y, math.random(Z2, Z1))
local money = moneyItem:Clone()
money.Parent = workspace
money.Position = moneyPos
task.wait(df)
end
return module
It’s in a module script because originally it was meant to be used by a couple of scripts, but currently is only used by one.
For coins to show up for one player only, this would require the use of LocalScripts as it is client-based. Yes, it is easy to cheat it, so you’ll need to add lots of checks
You would most likely have to handle the frequencies on the server, generate what you want to spawn, store it in a table for example, and tell the client that it spawned, the client handles the touch detection (it would be exploitable either way, and this is the easiest method), and then you can verify on the server whether the orb was actually spawned or not, and give the player the money based on that
Don’t spawn the coin on the server, and give network ownership of it to the player, everyone would see the coin and the player would be able to teleport it around and stuff, make the spawning server sided, but not the actual visible instance
I’m not really understanding your suggestion, I am new to scripting, and have only been doing this for a little bit, could you expand a little bit more?
You could have a system where the server generates coins for each payer you would then store what players can see that coin and pick it up along with picking up logic that checks that the player picking it up is in the player whitelist then on the client if the coins are in a folder somewhere you could scan through that folder and only display coins to the player if they are in that coins whitelist using LocalTransparencyModifier.
Hope you don’t mind this block of text with basically no grammar.
I am considering just making this mostly client side, as there will be no leaderboards anyways, so people who cheat to make the coins super OP for them are just ruining the fun for themselves
Send the client specific data that it can understand. The data should tell the client to make a new value with X amount of money per collection. Send data by using :FireClient(Player,Data).
Yeah but that requires a local script to accept the data which also eliminates the purpose of what the post maker said. + you can access remote events in replicated storage if someone can ‘hack’.
Hey everyone, ended up doing it a different way. I added a string attribute to the coin, which every spawn “wave” it spawns one for each player, and adds their userid to their personal coin, and the game checks if the ID’s match before picking it up and adding the money.