Hello, I wanted you to help me with something. What happens is that I have been looking for / creating a gravity script for R6 characters, but was unsuccessful, so I decided to search the toolbox for a free model, but according to my plugins the model I took contains viruses in the following script:
r = game:service("RunService")
Tool = script.Parent
local equalizingForce = 200 / 1.2
local gravity = .75
local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil
local myCharacter
local myPlayer
local head = nil
function recursiveGetLift(node)
local m = 0
local c = node:GetChildren()
if (node:FindFirstChild("Head") ~= nil) then head = node:FindFirstChild("Head") end
for i=1,#c do
if c[i].className == "Part" then
if (head ~= nil and (c[i].Position - head.Position).magnitude < 10) then
if c[i].Name == "Handle" then
m = m + (c[i]:GetMass() * equalizingForce * 1)
else
m = m + (c[i]:GetMass() * equalizingForce * gravity)
end
end
end
m = m + recursiveGetLift(c[i])
end
return m
end
function onMassChanged(child, char)
print("Mass changed:" .. child.Name .. " " .. char.Name)
if (ghostEffect ~= nil) then
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
end
end
function UpdateGhostState(isUnequipping)
if isUnequipping == true then
ghostEffect:Remove()
ghostEffect = nil
massCon1:disconnect()
massCon2:disconnect()
else
if ghostEffect == nil then
local char = Tool.Parent
if char == nil then return end
ghostEffect = Instance.new("BodyForce")
ghostEffect.Name = "GravityCoilEffect"
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
ghostEffect.Parent = char.Head
ghostChar = char
massCon1 = char.ChildAdded:connect(function(child) onMassChanged(child, char) end)
massCon2 = char.ChildRemoved:connect(function(child) onMassChanged(child, char) end)
end
end
end
function onEquipped()
myCharacter = Tool.Parent
UpdateGhostState(false)
Tool.Handle.CoilSound:Play()
lol = game.Players:GetPlayerFromCharacter(myCharacter)
if lol then
lol.PlayerGui.Musik.Song.Value = 1
end
end
function onUnequipped()
UpdateGhostState(true)
lolz = game.Players:GetPlayerFromCharacter(myCharacter)
if lolz then
lolz.PlayerGui.Musik.Song.Value = 0
end
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
But I donât understand what virus there is, I mean how is a virus detected, anyway the question is, is there a virus in the script? Since it may be that the plugin has failed. Thanks a lot