RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a sword equip system, equip with e button"
-- local script local sword = script.Parent local player = game.Players.LocalPlayer local equipped = false local function equipSword() if not equipped then equipped = true sword.Parent = player.Character sword.Handle.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position + Vector3.new(0,0,1)) sword.Handle.Anchored = false else equipped = false sword.Parent = game.Workspace sword.Handle.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position + Vector3.new(0,0,1)) sword.Handle.Anchored = true end end game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed) if input.KeyCode == Enum.KeyCode.E then equipSword() end end)