So im having this issue, When you join the game all of it seems fine, then whenever you die, When you respawn, The values And model duplicate??? how do i fix this? and it dupicates it 2 times more! (basically dupes of each value and model) on each death! help!
local copystand = stand:Clone() copystand.Parent = chr local horp = copystand["StandHumanoidRootPart"] local block = game:GetService("ServerStorage")["Block"] local copyblock = block:Clone() copyblock.Parent = chr local blockreduction = game:GetService("ServerStorage")["BlockReduction"] local copyblockreduction = blockreduction:Clone() copyblockreduction.Parent = chr copyblockreduction.Value = blockvalue local disabled = game:GetService("ServerStorage")["Disabled"] local copydisabled = disabled:Clone() copydisabled.Parent = chr local deflect = game:GetService("ServerStorage")["Deflect"] local copydeflect = deflect:Clone() copydeflect.Parent = chr local dodge = game:GetService("ServerStorage")["Dodge"] local copydodge = dodge:Clone() copydodge.Parent = chr local rtz = game:GetService("ServerStorage")["RTZ"] local copyrtz = rtz:Clone() copyrtz.Parent = chr
Well obviously, looking at your script you can see that everytime the person dies, the script runs again, meaning everything would get duplicated again, the way to fix this is to check if the object exists before cloning it.
local CheckForRtz = chr:FindFirstChild("RTZ") if CheckForRtz then return end elseif not CheckForRtz then local rtz = game:GetService("ServerStorage")["RTZ"] local copyrtz = rtz:Clone() copyrtz.Parent = chr end
I obviously only wrote it for one of those objects so just follow the same pattern for the others. If this helped you solve your problem please mark this as the answer! :)