local part = script.Parent -- Предполагаем, что скрипт находится в объекте Part
local accessoryId = "Ваш_Accessory_ID" -- Замените на ID вашего аксессуара
local function giveAccessory(player)
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
local accessory =
Instance.new ("Accessory")
accessory.Name = "MyAccessory"
accessory.AttachmentPoint =
Instance.new ("Attachment", accessory)
local handle =
Instance.new ("Part")
handle.Name = "Handle"
handle.Size =
Vector3.new (1, 1, 1)
handle.BrickColor =
BrickColor.new ("Bright blue") -- Замените на ваш цвет или модель
handle.Anchored = false
handle.CanCollide = false
handle.Parent = accessory
accessory.Handle = handle
accessory.Parent = character
accessory:MoveTo(character:FindFirstChild("Right Arm").Position)
end
end
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
giveAccessory(player)
end
end)