#help

38 messages · Page 1 of 1 (latest)

jovial ingot
#

i have a sword inside of replicated storage and when the game starts it moves the sword into tthe player making the player the parent and i want to reference the sword and when i use character:findfirstchild("sword") it says the sword has an infinite yield even though the character has been defined properly

#

😔

floral mango
#

can u show the script

storm fox
#

before it's equipped it is in Player.Backpack

jovial ingot
#

yeah

#

ok wait

#

lemme explaina lil more

#

when i load into the game there nothing

#

but

#

when i press e

#

its imeediated transported to the players hand

jovial ingot
#

the sword equiping script

#

or the script finding the sword

floral mango
#

both

jovial ingot
#

ok

jovial ingot
# floral mango both

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local sword = game.ReplicatedStorage:WaitForChild("Sword") -- Your sword model
local hand = character:WaitForChild("RightHand")

-- Function to attach the sword
local function attachSword()
local clonedSword = sword:Clone()
clonedSword.Parent = character

-- Set PrimaryPart
local handle = clonedSword:FindFirstChild("Handle") -- Replace with your handle's name
if handle then
    clonedSword.PrimaryPart = handle -- Set the PrimaryPart to the handle

    -- Create a normal weld
    local weld = Instance.new("Weld")
    weld.Part0 = handle
    weld.Part1 = hand
    weld.Parent = handle

    
    clonedSword:SetPrimaryPartCFrame(hand.CFrame * CFrame.new(0, -1, 0) * CFrame.Angles(0, math.rad(90), 0)) -- Adjusting rotation

else
    warn("Sword does not have a 'Handle' part.")
end

end

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
attachSword()
end
end)

trim karmaBOT
#

studio** You are now Level 7! **studio

jovial ingot
#

thats for attaching the sword

#

this is for looking for the sword

floral mango
#

maybe ur looking for the sword

#

before its in character

jovial ingot
#

erm

#

the whole animation script is inside of the script for the e keybind

#

like if e isnt pressed then the animation wont play

floral mango
jovial ingot
#

local

floral mango
#

are u using userinputservice to play the animation too?

jovial ingot
#

yeah

floral mango
#

im not sure why its not working then

jovial ingot
#

this is not sigma 😔

#

welp ill just stop for today then

#

thanks'

#

!!!

#

am i supposed to jsut close it or do something else when i wanna remove the post?

floral mango
#

prety sure u can just leave it