#Loot dropping script

1 messages · Page 1 of 1 (latest)

exotic arch
#

I am making an RPG type game and I have these enemies that when killed will drop loot. I want it so when the player touches the loot they will get it put in their inv. But my problem is I only want the player that got the loot only be able to see their loot. How would I do that while being secure exploit wise.

buoyant tangle
#

you can have a server event that fires to client telling client to spawn a loot thing, then when client touches it, tell the server that they got the loot and make surse that the loot dropped is in the lootpool of a recently killed enemy

solar crest
#

This is what first comes to my head. Keep in mind I've never designed a system like this before

For every player in the server, keep an array containing a set of uuids ({uuid1: true, uuid2: true, ...})

1: When the player does something, calculate their loot/rewards immediately on the server. Separate rewards by different loot "pickups". Assign each reward a uuid. Add all the reward uuids to the player uuid set, and store any other data you need in order to reward the player for their pickup. and send the client a remote with the uuids and corresponding rewards.
2: When the client receives the event, spawn the loot. When touched, find the uuid of the loot part, and send a message to the server saying "I picked up this uuid". Also delete the part.
3: On the server, validate that the player had that loot uuid available (check if playerUUIDSet[uuid] == true). If so, grant the rewards, remove the uuid from the reward set, and possibly send a message to the client to display a popup or whatever else you need.

sturdy schooner
#

just make the loot visible only on the players client and use server checks to make sure whoever touches it is the player it dropped for

wet steeple
#

just put the item on the client, and when they pick it up fire a remote telling the server the client picked up an item and should put it in their inventory

wet steeple
buoyant tangle
wet steeple
buoyant tangle
blissful hawkBOT
#

studio** You are now Level 3! **studio

buoyant tangle
#

and also you shouldnt not help someone make a secured one just because they cant amke an unsecure one

wet steeple
#

securing it is relatively easy compared to the first step

#

so... ya you can do things all at once and out of order if you want

#

🤷

buoyant tangle
#

still no reason to not tell them how to do the secure way just becuase they dont know how to do the unsecure one. Thats like telling someone they cant use functions because they dont know how to call a print statement. It doesnt matter if they dont know how to call a print statement, learning how to use a function also lets them learn how to call a print statemnet

#

also the vast majority of mistakes i made when iw as new to coding was because there were certain things i just did not know, like securing stuff on the server

#

not telling them is just aadding fuel tot he fire

wet steeple
#

why are you speaking for op? i'm pretty sure they can speak for themselves

buoyant tangle
wet steeple
#

and that is your opinion Thumbs

buoyant tangle
#

i hope you learned something here

wet steeple
#

and i hope you learned that not every response is intended for you

buoyant tangle
wet steeple
wet steeple
#

sure, kid

#

woe is me the day these kids figure out that not every response needs to contain 100% and complete information and may in fact be done deliberately as a setup for further discussion, but whatever, yep i'm the crazy one. 😮‍💨

buoyant tangle
wet steeple
wet steeple
#

😮‍💨

buoyant tangle
#

learn to sit back and observe, not everything needs a reaction

wet steeple
buoyant tangle
#

you made a good point on brewing further discussion but it would be much better to just include the information you didnt put in there in the first place

#

it still has no benefit

#

and only cons

#

and you shoiuld also learn to sit back and observe, not everything needs a reaction

wet steeple
#

look if you have anything constructive to add here that's fine, but i'm not interested in your irate karen rant just because you disagree with the approach.

buoyant tangle