#Duplication bug

48 messages · Page 1 of 1 (latest)

royal lantern
#

When you touch the armor it equips but keeps duplicating I don't know if I have to stop the script because I did use return and nothing happened

lucid lichen
#

you’re trying to check a condition after you execute the action

#

move the already equipped condition to the top and add a return

#

or, just add a return in that condition at the bottom after the print

royal lantern
#

like this?

#

Because that didnt work

lucid lichen
#
TouchPart.Touched:Connect(function(h)
  if h.Parent:FindFirstChild('Humanoid') then
    if (condition) then
      return;
    end
    --pass
  end
end)
royal lantern
#

because it didnt work

lucid lichen
#

no, you need to change the condition part to it checking if it is already equipped

#

if so; you return

#

return = stops running the rest of the function, basically returns the information the function provided and stops there

royal lantern
#

I get what return does but wym condition

lucid lichen
#

condition = check to see if it already equipped

#

so your condition would be

if char.UpperTorso ~= nil then
#

i'm still trying to wrap my head around how that works but that would be your condition

royal lantern
#

well when I asked my friend he said thats what to do and it didnt work

lucid lichen
#

because your condition is invalid, i mean you actually have to check if it is there, try this:

if char:FindFirstChild('Weld') then return end
#

also move

local chestweld = Instance.new('Weld')
#

into the main .touched signal

royal lantern
#

so this?

#

YAY

#

it works

#

now I can polish it up and boom I have my first class thanks man

lucid lichen
#

😄

hidden valve
#

local on = false

#

then at the start of equipping

#

if on == false then
script here
end

#

and at the end of the script

#

do on = true

#

thats the most simple way

#

even though this is already solved

royal lantern
#

solved but not really

#

so the visual duplication is fixed

#

but

#

It duplicates on the player

#

no visual but I think it might still be laggy

#

anyone knows what to do?

warm goblet
#

is it cloned form replicated storage

royal lantern
#

no actually

#

Idk for some reason I have it in the lighting folder

#

dont really remember why but it worked so I just left it there

#

maybe I should put it in replicated storage

warm goblet
#

you should

royal lantern
#

so I did

#

but it still duplicates