#Loot dropping script
1 messages · Page 1 of 1 (latest)
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
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.
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
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
this is unsafe
if they can't do the basic naive one, they can't do the safe one.
they are literally asking for a secure one
if the can't do the unsecured one, they cannot do the secure one.
what makes you think they cant do the unsecured one
** You are now Level 3! **
and also you shouldnt not help someone make a secured one just because they cant amke an unsecure one
well if they can make the per-player loot as a starting point, and they don't know how to secure it, i'm sure they'll ask about that. but the first step is the per-player loot, which you would do as i had described.
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
🤷
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
why are you speaking for op? i'm pretty sure they can speak for themselves
im not speaking for op, im saying why its a bad idea to not tell a pesron specific information just because they dont know the general information
and that is your opinion 
i hope you learned something here
and i hope you learned that not every response is intended for you
lvl 1 ragebait
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. 😮💨
@wet steeple
clearly misunderstood the point of why i posted that
this being the point btw
😮💨
learn to sit back and observe, not everything needs a reaction
jeez, i didn't know that hit a nerve for you
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
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.
idk i think what i said was pretty constructive