Hello DevForum! Long time no see. To quickly get into my issue, I have no idea how to change the AccessoryType of this vest! I want it to attach to the torso by making the AccessoryType Front but I don’t know how to achieve this. Much appreciated, Snale.
local tool=script.Parent
local handle=tool.Handle
local remotefunction=tool.RemoteFunction
local debris=game:GetService("Debris")
function remotefunction.OnServerInvoke(player,command,value)
if command=="protect" then
if value[2] then
local currentvest=value[1]:FindFirstChild("VestArmour")
if currentvest then
currentvest:Destroy()
end
local vest=Instance.new("Accessory")
vest.Name="VestArmour"
local handle=handle:Clone()
handle.Parent=vest
vest.AttachmentPos=Vector3.new(0,0,0)
vest.Parent=value[1]
local ratio=value[2].Health/value[2].MaxHealth
value[2].MaxHealth=100+value[3]
value[2].Health=(100+value[3])*ratio
tool:Destroy(function()
end)
end
end
end
local tool=script.Parent
local handle=tool.Handle
local remotefunction=tool.RemoteFunction
local debris=game:GetService("Debris")
function remotefunction.OnServerInvoke(player,command,value)
if command=="protect" then
if value[2] then
local currentvest=value[1]:FindFirstChild("VestArmour")
if currentvest then
currentvest:Destroy()
end
local vest=Instance.new("Accessory")
vest.AccessoryType = Enum.AccessoryType.Front
vest.Name="VestArmour"
local handle=handle:Clone()
handle.Parent=vest
vest.AttachmentPos=Vector3.new(0,0,0)
vest.Parent=value[1]
local ratio=value[2].Health/value[2].MaxHealth
value[2].MaxHealth=100+value[3]
value[2].Health=(100+value[3])*ratio
tool:Destroy(function()
end)
end
end
end