Hi everyone! Im trying to make a part collide with ‘Paper’ Tool, And once it does that it deletes the paper, And increases the money currency (In leaderstats)
My problem is the collision detection, I haven’t found a way to do it, But this is my broken script I came up with:
local part = script.Parent
local handle = game.ReplicatedStorage.Paper
local function onPartTouched(Handle)
print(part.Name .. " has touched " .. Handle)
end
part.Touched:Connect(onPartTouched)
Different collision group baseparts aren’t capable of interacting with each other. If you want to keep this behaviour then have a invisible cancollide false part welded as the size boundingbox of your character and have it the same collission group as the paper
I have updated the script, Not realised my mistake but it still isn’t working???
local part = script.Parent
local handle = game.Workspace.Paper.Handle -- changed variable to actual place.
local function onPartTouched(Handle)
print((part.Name .. " has touched " .. handle.Name))
end
part.Touched:Connect(onPartTouched)
My first response was referring to something completely different. I was assuming you was having an issue with different collision groups. I’m extremely confused to what you’re attempting to achieve also your code above is still wrong, You need to capitalize the first letter of "h"andle.Name. If they are both the same collision group and the handle actively collides with the “part” then this would work. if that’s not the problem, Since it’s not working something else is wrong with your workspace layout.
I want this to happen: When paper collides with SellPoint, Delete paper, And add leaderstat currency to it, My trouble is the collision part, The part is anchored, And collide set to true.
Once the paper is spawned, It is in workspace, Then after you pick it up, It is in Player.Backpack. Then when you drop it its back into workspace.
Once testing your fix, This happened.
“Position is not a valid member of workspace.paper”