Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
Edited 5 years ago

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

0
Please format the code so we can see it. BennyBoiOriginal 293 — 5y
0
alright srry how do i do that Mbattleaxe -3 — 5y
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. BennyBoiOriginal 293 — 5y
0
In your code, maybe you could put various print() statements to see if parts of the script are working BennyBoiOriginal 293 — 5y
0
it works but is not local Mbattleaxe -3 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

0
This is not as simple as copy and paste into a local script and disable the other script. Mbattleaxe -3 — 5y
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 beeswithstingerss 41 — 5y
0
yes, but idk how to change the current script to a local script. that is my question Mbattleaxe -3 — 5y
0
Once you spawn the coins from the client, it should still work if that script is a child of the coin beeswithstingerss 41 — 5y
View all comments (5 more)
0
this script is inside the coin, but how to make the other script? Mbattleaxe -3 — 5y
0
I assume that you already have a script outside of the coin to spawn, am I correct with this or no? beeswithstingerss 41 — 5y
0
no, the script that i provided is the only script that actually does the work Mbattleaxe -3 — 5y
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 beeswithstingerss 41 — 5y
0
I have no idea what you are talking about.. sorry Mbattleaxe -3 — 5y
Ad

Answer this question