You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
So I added fixed coins on the map (not random spawned) that players can collect. The problem with that is, that it works fine, as long as I use only one coin. As soon as I add another coin, with the same path name, the script seems not to work anymore. Also I have a problem with adding a cooldown, so people can’t just farm as much coins as they want. I tried it with wait(), but it looks like it doesn’t change anything. -
What is the issue? Include screenshots / videos if possible!
Here is my code:
local coinAward = 75
game.Workspace.Test.Test.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") then
local characterName = part.Parent.Name
local currencyStore = DataStore2("currency", players[characterName])
currencyStore:Increment(coinAward)
end
end)
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
So I already know that it doesn’t work as soon as I got two models with the same name. But I think putting the same code with a different part wouldn’t be good depending on resources used and I’m pretty sure there is a better solution.
Maybe someone can help me with that problem. Thank you already.