Hello fellows people! The video below shows my issue. I have the “candy” currency in my game where everytime a player picks up a candy it disappears & the value of their candies go up
Here’s the video
This is the coin script thats making it work (its a local script in StarterCharacterScripts) ^
And this is in the server script service ^
Basically in the last photo I added that to my obby checkpoint system that already contains the leaderstats
First of all I recommend moving the variables you re-use outside of the pairs loop. Player, char, Value… No need to redefine them with every loop since they don’t change.
Do the candies spawn dynamically through a script? Or did you put them in place manually on Studio?
hey i appreciate the response. the candy does have the correct tag. I did forget to mention I am not experienced with scripting so if the coding looks dumb thats why lol
How would I add the coin and touched variables in?
Drag your whole code and put it inside a server script inside server script service, and get the player using hit.Parent with method: :GetPlayerFromCharacter(hit.Parent) and add the values on the server, and also if you are not going to use the candy, destroy it instead of hiding it, if you do enough search, you will know how to get the player from the Touched event since you are new, if you want to hide the candy for the player only fire a remote event to the client with the candy as a parameter and destroy it on the client.