Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make this coin collector script work in a local script?

I am trying to make a coin that does not disappear for other players when a specific player gets it. Can anyone help? Coin collector script is below.

https://docs.google.com/document/d/1ovj05vBYUQi-sYfgLZZHLxtmv30zjVYja6ccyn6rMKI/edit?usp=sharing

5 comments

0

Please format the code so we can see it.

0

alright srry how do i do that

0

When you paste your code, there's a little button: https://imgur.com/a/NUms75r that you can click to format your code. Just highlight your code and press it and it should be all good.

0

In your code, maybe you could put various print() statements to see if parts of the script are working

0

it works but is not local

1 answer

You are currently using a normal script meaning that it happens for the server. If you spawn the coins via a local script inside the player, each coin should be client side.

9 comments

0

This is not as simple as copy and paste into a local script and disable the other script.

0

No, I'm not saying to copy and paste. I'm saying to spawn the coins, using a different script, on the client side

0

yes, but idk how to change the current script to a local script. that is my question

0

Once you spawn the coins from the client, it should still work if that script is a child of the coin

0

this script is inside the coin, but how to make the other script?

0

I assume that you already have a script outside of the coin to spawn, am I correct with this or no?

0

no, the script that i provided is the only script that actually does the work

0

So create a local script that looks at a value (Total coins) in the player and if it's less than the number you want, spawn coins slowly based on a random number. When a coin is added, make a counter to the value. Again, do this on the client using a local script

0

I have no idea what you are talking about.. sorry

This discussion is preserved as it was. New answers, comments, and votes are closed.