#ReplicatedStorage collection problem

7 messages · Page 1 of 1 (latest)

sturdy condor
#

I made a script inside of a model thats parented by ReplicatedStorage. Inside of serverscript service, theres a script that clones the model and spawns it into workspace indefinetly, making more clones of the same model from ReplicatedStorage. The script inside of the model is supposed to be like this: You touch it and it adds 1 to your money and then destroys itself. The issue I'm having is that it does this with every model with the same name thats currently in the workspace, but I only want it do it with the one touched model. This is my script

`script.Parent.CanCollide = true
local Sound = workspace.Sounds
local cloning

script.Parent.Touched:Connect(function(hit)
cloning = script.Parent:Clone()
local humanoid = game.Players:GetPlayerFromCharacter(hit.parent)
if humanoid then
humanoid.leaderstats.Marbles.Value = humanoid.leaderstats.Marbles.Value + 1
print("Marbles +1")
Sound.collect:Play()
workspace.Marble1:Destroy()
end
end)`

worn citrus
#

It does it for one its the workspace.Marbel1:Destroy() that would affect it

#

Try changing it to script.Parent:Destroy()

sturdy condor
#

Normally i would do that but the parent is the union. Is there any way to make it destroy Marble1 without using the original script?

bleak inlet
sturdy condor
#

ur awesome man thanks