How do i make a zone where when in it gives you sword

What im trying to achieve is just making a simple sword fight
I know theirs some already out there but i need more of the break down
So far have the part can-collide off with anchored

What I need is a Example script not the actual script so i can learn
– ExoticTwix

A nearly identical topic has been going on for the last half-hour now.

You could create an invisible, non-collide-able area (part) that when touched would trigger code.

For example, you could use BasePart:GetTouchingParts() (if you use this, then be sure to read this post: [Obsolete] Simple trick to make GetTouchingParts work with non-CanCollide parts) or (simpler) BasePart.Touched:Connect() (if you choose this, then make it like a pipe you fall through that runs the code so that you wouldn’t constantly have :Connect requests being sent by anybody in the area).

CODE SAMPLE

for i,v in pairs(BasePart:GetTouchingParts()) do
    -- run code
end

CODE SAMPLE

local function onTouched(Part)
    -- run code
end

BasePart.Touched:Connect(onTouched)
2 Likes