I Tried To Use A Tool That Gives A Accessory To The Player, but it doesn't work? Please Help
Local Script Inside The Tool:
local tool = script.Parent
local use = script.Parent.Sounds.Cape
local RS = game:GetService("ReplicatedStorage")
local Wear = RS:FindFirstChild("SigilWear")
local Unwear = RS:FindFirstChild("SigilUnwear")
local wearing = false
tool.Deactivated:Connect(function()
if not wearing then
use:Play()
Wear:FireServer()
wearing = true
else
use:Play()
Unwear:FireServer()
wearing = false
end
end)
The script in server script service:
local RS = game:GetService("ReplicatedStorage")
local Wear = RS:FindFirstChild("SigilWear")
local Unwear = RS:FindFirstChild("SigilUnwear")
local helm = RS:FindFirstChild("Sigil")
local plr = game.Players.LocalPlayer
local char = ((plr.Character and plr.Character.Parent) and plr.Character) or plr.CharacterAdded:Wait()
local human = char:WaitForChild("Humanoid")
Wear.OnServerEvent:Connect(function()
sigilclone = helm:Clone()
human:AddAcessory(sigilclone)
end)
Unwear.OnServerEvent:Connect(function()
sigilclone:Destroy()
end)

1 comment
Put the script in the tool.