#how can i fix this ?
1 messages · Page 1 of 1 (latest)
Put the handle of the tool more above
I don't know how the logic of your scripts work but, make the click part only give the tool to you and adjust the handle to the position you want it to be
I would recommend you to make a tool, on every grab able model you put a invisible handle and when you click the grab part it grabs the model with the handle, puts it into a tool and then parents it to the player inv
ookok
nice avatar btw
that's wild
a few options, you could go the tool route but the smallest work would probably be using an attachment as the handle position, or some handle part, or you might be able to do something with the pivot point
such that the handle and the click detector are separate
thx bro
if u want i can give u the script to see
local Players = game:GetService("Players")
local lp = Players.LocalPlayer
local Tool = script.Parent
local Anim = script:FindFirstChild("Idle")
-- Wait for character and humanoid to be ready
local character = lp.Character or lp.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
-- Load the animation
local Loaded = animator:LoadAnimation(Anim)
local Weld = nil
-- Attach Zone part above player's head
local function attachAboveHead()
local head = character:FindFirstChild("Head")
local zone = Tool:FindFirstChild("Zone")
if not head or not zone then return end
-- Remove existing welds
for _, w in ipairs(zone:GetChildren()) do
if w:IsA("WeldConstraint") then
w:Destroy()
end
end
-- Create new weld
Weld = Instance.new("WeldConstraint")
Weld.Name = "AboveHeadWeld"
Weld.Part0 = zone
Weld.Part1 = head
Weld.Parent = zone
-- Position zone above the head
local offset = Vector3.new(0, 0, 0)
zone.CFrame = head.CFrame * CFrame.new(offset)
zone.Anchored = false
end
-- Detach Zone from head
local function detachFromHead()
local zone = Tool:FindFirstChild("Zone")
if zone then
for _, w in ipairs(zone:GetChildren()) do
if w:IsA("WeldConstraint") and w.Name == "AboveHeadWeld" then
w:Destroy()
end
end
end
end
-- Handle Equip
local function Equipped()
if not Loaded then
Loaded = animator:LoadAnimation(Anim)
end
Loaded:Play()
attachAboveHead()
end
-- Handle Unequip
local function Unequipped()
if Loaded then
Loaded:Stop()
end
detachFromHead()
end
-- Bind events
Tool.Equipped:Connect(Equipped)
Tool.Unequipped:Connect(Unequipped)
-- If tool is already equipped when script runs
if Tool.Parent == character then
Equipped()
end
-- Position zone above the head local offset = Vector3.new(0, 0, 0) zone.CFrame = head.CFrame * CFrame.new(offset) zone.Anchored = false
set offset to an attachment's local position
which is pretty much simply this i pretty sure https://create.roblox.com/docs/reference/engine/classes/Attachment#CFrame
then put attachment in the zone and use that 👍
also you should set that position before welding it otherwise it will teleport the player with it (and appear to do nothing)
yess
but when i put the a position that do nothing
i already tried to change it but it dosen't work :/
OK MB
wait
dont forget to move the attachment to where the hands should be
if you do zone.CFrame = head.CFrame * attachment.CFrame then it will also inherit the attachment's rotation
or you could just rotate the zone, either/or 🤷
idk its not working..
show updated code
i did also say you need to set this position before you weld it
coz setting cframe of any part of an assembly will move the entire assembly, including the player if it's welded to the player
sorry if im dumb bro but im new to studio and yea im bad 🥲
so your change is correct here, you'd want to pipe in an attachment instead of setting the offset manually for every object, and move this block of code to before where the weld is created
tho i'm guessing ai wrote this for you
yess but im learning code to i know function and alot
because ai is not very yea
bro i don't very understand that crazy but thanks for ur help brotha
@desert yarrow can u just say what do i need to do to fix it please 🙏
i did
yes. i will read and try my best (btw im not english )
that is just i yo u can resume 🥲 🙏
@desert yarrow Can you just send me the correct code or things to do please bro im stuck
🙏
im sorry if im annoying but i need help
@clear mauve Can you just send me the 300 robuck or to do please bro im poor
🙏 sorry if annoying but i dont spoonfeed 🥣
uhh i don't get it alrd :/
why are u begging me for robux ? do you need some ??
im just asking for help
i can give u robux but it feels a littl troll ?
for reference that is worth a little under usd$1 after devex, buy-in is about usd$3.50 if you buy at bulk rate without bonuses
me either but it's a standard currency you can use to convert and gauge what 300 robuck is worth ;p