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

I haven't scripted in a while but I have a question?

Asked by 2 years ago

I haven't scripted in forever! So here is my first question.

Why and how do I fix it when two parts which have the same script won't run nor function the same.

I have two parts which have the same script. Both of them are for when you jump on the block then it drops and reappears again at the original position it was at.

Now when two parts have this same script you jump on the first part and it works as it should... But when you jump on the second part it activates the first part even if they are under the same name or script. Here is the script to collaborate onwards.

local droppie = game.Workspace.DropBlock
local drop = script.Parent
local dropperTouched = false


drop.Touched:Connect(function()
    if not dropperTouched then


        dropperTouched = true
        print("Dropper has been dropped!")
        droppie.Anchored = false
        wait(1.5)
        droppie.Transparency = 1
        wait(1.5)
        droppie.Transparency = 0
        droppie.Anchored = true
        droppie.Position = Vector3.new(-110.227, 21.357, -7.408)
        droppie.Orientation = Vector3.new(0,0,0)

        dropperTouched = false      

    end 

end)

I added a debounce due to me hating that the touch function runs multiple times but besides the point. And I do realise that even if I moved a part it would return to the same Position because it was assigned one but I am here for why one runs the script of the other part.

An example or explanation would help thank you!

0
So is it basically like you step on one block and then jump onto the next one, which then causes the one you just jumped off, to fall? Voltaicmimic 43 — 2y
0
Are there multiple parts named DropBlock? echobloxia 21 — 2y
0
I suppose I need to have different names for all of them? menofmen1234 20 — 2y

Answer this question