#big tool causes weird player movement

1 messages · Page 1 of 1 (latest)

half grail
#

aight so i have this melee tool and when you kill someone it makes a clone of their avatar and stacks it onto the tool but the longer it is it makes the players movement go all weird. especially when jumping. and yes everything is set to massless

the problem im having is that the torso of the clones is constantly having its cancollide property switched on. Ive been using a script to disable it but it keeps automatically switching on. How do i fix this 🙏

and ive already tried collision groups and it didnt work

prime walrus
half grail
#

pls dont ghost me bc im bad at scripting

#

and for asking a stupid question that ion know is stupid

gritty nacelle
gritty nacelle
#

You said you used a script to turn of cancollide

#

Then said but it keeps randomly switching on

half grail
#

i read something online it says roblox enables collision for npc/player torsos to stop them from noclipping

#

idk if its true though

half grail
gritty nacelle
#

Send your script

half grail
#

bro wtf

#

everytime i copy it it sends as a text file

gritty nacelle
#

Put lua Your code then

#

Shit

half grail
#

??

gritty nacelle
half grail
gritty nacelle
#

And send what's necessary discord won't allow too many characters

half grail
#

vro

gritty nacelle
#

You just need whatever's to do with collision

half grail
#

k

#
                for index, instance in pairs(clone:GetDescendants()) do -- make  massless
                        if instance:IsA("Part") then
                            instance.Massless = true
                            instance.CanCollide = false
                            instance.Anchored = false
                            print("asdf")
                        end
                    end

                    local hitboxweld = Instance.new("Motor6D")
                    hitboxweld.Parent = tool.noob.IDKWHATTONAMETHISPART
                    hitboxweld.Part0 = tool.noob.IDKWHATTONAMETHISPART
                    hitboxweld.Part1 = clone.Torso
                    hitboxweld.C0 = CFrame.new(0, -2.5 + scalenum / 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
                    hitboxweld.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
        end
#

@gritty nacelle

#

it makes it massless

#

it unachors everything

#

it turns off collisions for everything

#

but the torso decides to leave collisions on

gritty nacelle
#

So because it's a tool Roblox might be resetting its properties specifically anchored and collision

half grail
#

anchored is off

#

so is massless

#

for the torso

gritty nacelle
#

Try this it's a bit odd

#

Add CustomNoCollide under all your parts inside your tool

#

Y'know how to add an attribute

#

Scroll to the bottom of the parts properties

half grail
#

then what

gritty nacelle
#
game:GetService("RunService").Heartbeat:Connect(function()
    for _, part in pairs(clone:GetDescendants()) do
        if part:IsA("BasePart") and part:GetAttribute("CustomNoCollide") then
            part.CanCollide = false
        end
    end
end)
#

Then we use heartbeat service which just keeps telling the part to stay no collision

#

If your parts not a basepart you'll need to change that

#

Say a model or mesh

half grail
#

whatever a torso is

#

where do i put it

gritty nacelle
#

Server script

#

ServerScriptService

half grail
#

well how do i make a new attribute in a script

#

oh wait nvm

gritty nacelle
#

Or here me out

#

local tool = script.Parent

tool.Equipped:Connect(function(mouse)
    local player = game.Players:GetPlayerFromCharacter(tool.Parent)
    if not player then return end

    -- Clone the noob model
    local noobTemplate = game.ReplicatedStorage:WaitForChild("NoobModel")
    local clone = noobTemplate:Clone()

    -- Make all parts massless, non-collidable, and unanchored
    for _, part in pairs(clone:GetDescendants()) do
        if part:IsA("BasePart") then
            part.Massless = true
            part.CanCollide = false
            part.Anchored = false
        end
    end

    -- Parent the clone somewhere visible (e.g. workspace)
    clone.Parent = workspace

    -- Weld it to the sword
    local swordPart = tool:WaitForChild("noob"):WaitForChild("IDKWHATTONAMETHISPART")
    local torso = clone:FindFirstChild("Torso") or clone:FindFirstChild("UpperTorso")

    if torso and swordPart then
        local weld = Instance.new("Motor6D")
        weld.Part0 = swordPart
        weld.Part1 = torso
        weld.C0 = CFrame.new(0, -2.5, 0)
        weld.C1 = CFrame.new(0, 0, 0)
        weld.Parent = swordPart
    else
        warn("Missing torso or sword part.")
    end
end)
#

Script under the tool

#

Makes referencing it easier

half grail
#

this is how its set up

gritty nacelle
#

Yeah js stick it under the rool

#

Tool

half grail
#

?

gritty nacelle
#

There's the full script

#

wait im on pc lemme do it properly lol

#

phone is ass

half grail
#

u wrote that all on a phone

gritty nacelle
#
local tool = script.Parent
local replicatedStorage = game:GetService("ReplicatedStorage")
local runService = game:GetService("RunService")
local noobTemplate = replicatedStorage:WaitForChild("NoobModel")
local scalenum = 1.0
local clone 
local heartbeatConnection

tool.Equipped:Connect(function()
    local player = game.Players:GetPlayerFromCharacter(tool.Parent)
    if not player then return end
    
    -- Clone and prepare the model
    clone = noobTemplate:Clone()
    for _, part in pairs(clone:GetDescendants()) do
        if part:IsA("BasePart") then
            part.Massless = true
            part.CanCollide = false
            part.Anchored = false
            part:SetAttribute("CustomNoCollide", true) -- used for Heartbeat check
        end
    end
    clone.Parent = workspace
    
    -- Weld it to the Tool part
    local attachPart = tool:WaitForChild("noob"):WaitForChild("IDKWHATTONAMETHISPART")
    local torso = clone:FindFirstChild("Torso") or clone:FindFirstChild("UpperTorso")
    if torso and attachPart then
        local weld = Instance.new("Motor6D")
        weld.Part0 = attachPart
        weld.Part1 = torso
        weld.C0 = CFrame.new(0, -2.5 + scalenum / 1, 0)
        weld.C1 = CFrame.new(0, 0, 0)
        weld.Parent = attachPart
    else
        warn("Torso or attach part not found.")
    end
    
    -- Start the heartbeat connection to force CanCollide = false
    heartbeatConnection = runService.Heartbeat:Connect(function()
        if not clone then return end
        for _, part in pairs(clone:GetDescendants()) do
            if part:IsA("BasePart") and part:GetAttribute("CustomNoCollide") then
                if part.CanCollide then
                    part.CanCollide = false
                end
            end
        end
    end)
end)
#
tool.Unequipped:Connect(function()
    -- Clean up when tool is unequipped
    if clone then
        clone:Destroy()
        clone = nil
    end
    
    -- Disconnect the heartbeat connection
    if heartbeatConnection then
        heartbeatConnection:Disconnect()
        heartbeatConnection = nil
    end
end)
#

all one script

#

this will set the attribute

half grail
#

let me try it

gritty nacelle
#

you can ditch part of that code

#

this works

#

got my mini me through the wall

#

mad complicated but it works

#

ill try debug it into something simplier

#

js dont got much time rn

#

does work tho

half grail
#

it didnt work

#

wait hold on

#

yea it isnt

#

idk if its me that doesnt know where to place stuff but

gritty nacelle
#

probably referencing your sword wrong

#

hmm

#

wait

half grail
#

the dummies are in a folder inside the tool

gritty nacelle
#

so you can js turn bros collision off

#

i removed the models hrp and humanoid

#

just incase thats whats making roblox auto set collision

#

but the clothing of the model falls off

half grail
#

ye

gritty nacelle
#

so if you can keep them on say with a weld

#

it should be ggs

half grail
#

they are with a weld

#

but i want to keep the clothes

gritty nacelle
#

i think i know how

#

i wouldnt want a naked sword either

#

lemme try

half grail
#

?

gritty nacelle
# half grail ?

so is the main issue you want the sword to not collide with parts like walls and the ground

#

or players

half grail
#

sword cant collide with anything

gritty nacelle
#

yeah thats gonna be an issue since clothing cant be welded

#

the only other issue is you need to use something like blender

#

make all of the model into a mesh

#

meaning you can then likely just turn collision off

#

no clothing issue

half grail
#

ok

gritty nacelle
#

i think you could probably just directly export it from roblox into blender but im no blender god

half grail
#

aight ill try it

gritty nacelle
#

that was easy

#

@half grail

#

you can infact do it like this lol

#

no scripts