Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I convert this From a Local Script to FE? [closed]

Asked by 4 years ago

i'm Still relatively new to remotes and stuff and i'm trying to fix a lot of the broken scripts but i cant seem to figure out whats wrong with this one the script would play through but it'll only be client sided

bin = script.Parent
Backpack = bin.Parent
me = Backpack.Parent
Character = me.Character
humanoid = Character.Humanoid
torso = Character.Torso
rightarm = Character["Right Arm"]
leftarm = Character["Left Arm"]
rightleg = Character["Right Leg"]
leftleg = Character["Left Leg"]
LeftShoulder = torso["Left Shoulder"]
RightShoulder = torso["Right Shoulder"]
LeftHip = torso["Left Hip"]
RightHip = torso["Right Hip"]
Neck = torso["Neck"]
RightShoulderC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
LeftShoulderC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
LeftHipC0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
RightHipC0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)

function null()
RightShoulder.C0 = RightShoulderC0
LeftShoulder.C0 = LeftShoulderC0
RightHip.C0 = RightHipC0
LeftHip.C0 = LeftHipC0
end

local COOLDOWN = 1.5




r = game:service("RunService")


MAX_VELOCITY  = 180
MIN_VELOCITY  = 20

PULLBACK_TIME = 0

wait(0.1)



function computeDirection(vec)
    local lenSquared = vec.magnitude * vec.magnitude
    local invSqrt = 1 / math.sqrt(lenSquared)
    return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end

enabled = true
function onButton1Down(mouse)
    if not enabled then
        return
    end

    local player = game.Players.LocalPlayer
    if player == nil then return end

    enabled = false
    mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"

    local pos = mouse.Hit.p
    pos1 = torso.Position
    torso.Anchored = true
FireGrow1 = Instance.new("Part")
FireGrow1.Parent = Character
FireGrow1.Name = "FireGrow"
FireGrow1.CanCollide = false
FireGrow1.Anchored = true
FireGrow1.Shape = "Block"
FireGrow1.Locked = true
FireGrow1.Transparency = 0.9
FireGrow1.Reflectance = 0.5
FireGrow1.TopSurface = "Smooth"
FireGrow1.BottomSurface = "Smooth"
FireGrow1.formFactor = "Symmetric"
FireGrow1.BrickColor = BrickColor.new("White")
FireGrow1.CFrame = torso.CFrame * CFrame.new(0, 0, -(pos1-pos).magnitude) * CFrame.Angles(1.57, 0, 0)
FireGrow1.Size = Vector3.new(1, 1, 1)
if (torso.Position-pos).magnitude <= 500 then
for i = 1, 20 do    
FireGrow1.Size = FireGrow1.Size + Vector3.new(2, 2, 2)
FireGrow1.CFrame = torso.CFrame * CFrame.new(0, 0+(i/2), -(pos1-pos).magnitude)
wait(.001)
end
for i = 1, 20 do    
     for u, c in pairs(workspace:GetChildren()) do
     if c.Name ~= me.Name then
      h = c:findFirstChild("Humanoid")
      t = c:findFirstChild("Torso")
      if h ~= nil and t ~= nil then
       if (FireGrow1.Position-t.Position).magnitude <= 30 then
if h.Parent:findFirstChild("Logia") == nil or h.Parent:findFirstChild("Logia").Value == false or Character.Busoshoku.Value == true and h.Parent:findFirstChild("ForceField") == nil then
          h.Health = h.Health - 0.5
        if i < 50 then
          h.Sit = true
          h.Health = h.Health - 0.5
        end
        if i >= 50 then
         if h ~= nil and t ~= nil then
          h.Sit = true
          h.Health = h.Health - 0.5
          end
         end
        end
       end
      end
     end
    end
wait()
end
    torso.Anchored = false
for i = 1, 50 do    
     for u, c in pairs(workspace:GetChildren()) do
     if c.Name ~= me.Name then
      h = c:findFirstChild("Humanoid")
      t = c:findFirstChild("Torso")
      if h ~= nil and t ~= nil then
       if (FireGrow1.Position-t.Position).magnitude <= 30 then
if h.Parent:findFirstChild("Logia") == nil or h.Parent:findFirstChild("Logia").Value == false or Character.Busoshoku.Value == true and h.Parent:findFirstChild("ForceField") == nil then
         h.PlatformStand = true
        if i < 50 then
          h.Sit = true
          h.Health = h.Health - 0.5
        end
        if i <= 50 then
         if h ~= nil and t ~= nil then
          h.Sit = true
          h.Health = h.Health - 0.5
          end
         end
        end
       end
      end
     end
    end
wait()
end
end
null()
    FireGrow1:Remove()
    torso.Anchored = false
    wait(3)
    mouse.Icon = "rbxasset://textures\\GunCursor.png"
    enabled = true

end

function onSelected(mouse)
    mouse.Icon = "rbxasset://textures\\GunCursor.png"
    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

script.Parent.Selected:connect(onSelected)

Closed as Not Constructive by alphawolvess and hiimgoodpack

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?