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

Why do i get this error? ('=' expected near)

Asked by 8 years ago

error: 21:32:13.931 - Players.Player1.Backpack.Tool.LocalScript:79: '=' expected near '­'

--Variables
local hMouse = game:GetService('UserInputService')
local player = game.Players.LocalPlayer
local m = player:GetMouse()
local tool = script.Parent
local hud = script.mainGui
local hud2 = script.mainGui:GetChildren()

--Script stuff
hud.Parent = player.PlayerGui

for i,v in pairs(hud2) do
    v.Visible = false
    function Equip()
        wait(.5)
        hMouse.MouseIconEnabled = false
        v.Visible = true
    end
    function Unequip()
        wait()
        hMouse.MouseIconEnabled = true
        v.Visible = false
    end
end

function activate()
    local b = Instance.new('Part',workspace.Store)
    b.Shape = 'Ball'
    b.TopSurface = 'Smooth'
    b.BottomSurface = 'Smooth'
    b.Size = Vector3.new(.2,.2,.2)
    b.CanCollide = false
    b.CFrame = tool.B.CFrame
    b.CFrame = CFrame.new(b.Position, m.Hit.p)
    local vc = Instance.new('BodyVelocity', b)
    vc.velocity = b.CFrame.lookVector *90
    vc.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
    game.Debris:AddItem(b,5)
    --[Reload]--
    game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
    if string.lower(key) == "r" then
        local Player = game.Players.LocalPlayer
        local Character = game.Workspace:WaitForChild(Player.Name)
        local Torso = Character:WaitForChild("Torso")
        local LArm = Character:WaitForChild("Left Arm")
        local RArm = Character:WaitForChild("Right Arm")

        local Weld = Instance.new("Weld",LArm)
        Weld.Part0 = LArm
        Weld.Part1 = Torso
        Weld.C0 = CFrame.new(1.5,0,0)

        local Anim1 = {
        CFrame.new(1.13300705, 0.835922241, 0.159999847, 0.547842026, 9.90731905e-008, -0.836581826, 0.836581826, -2.50802458e-007, 0.547842026, -1.5554032e-007, -1, -2.20282942e-007),        

        CFrame.new(1.13299561, 0.546646118, 0.65234375, 0.547838628, 1.24659664e-005, -0.836584151, 0.648288667, 0.632048845, 0.424542397, 0.528767228, -0.77492857, 0.34625262),       

        CFrame.new(1.13300705, 0.835922241, 0.159999847, 0.547840714, 3.65681885e-008, -0.836582661, 0.836582661, -2.39468783e-008, 0.547840714, 0, -1, -4.37113883e-008)
        }

        local Target = Anim1[1]

        function Animation1()

        Target = Anim1[1]

        for i,v in pairs(Anim1) do
        Target = Anim1[i]
        wait(0.05) --Mess around with this :^)
        end

        Target = Anim1[1]

        end

        local Speed = 0.2
        wait(3)

        game:GetService("RunService").RenderStep­ped:connect(function()
        Weld.C0 = Weld.C0:lerp(Target,Speed) 
        end)

        while wait(2) do
        Animation1()
        end
    end
    end)
end

--Misc functions
tool.Equipped:connect(Equip)
tool.Unequipped:connect(Unequip)
tool.Activated:connect(activate)

2 answers

Log in to vote
0
Answered by
ItsMeKlc 235 Moderation Voter
8 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

Try replacing 79-81 with

local renderstepped = game:GetService("RunService").RenderStepped 
a = renderstepped:connect(function() 
    Weld.C0 = Weld.C0:lerp(Target,Speed)
 end)
0
I will try this tomorrow and if it works then it's an answer accepted Quote545 0 — 8y
Ad
Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

You have an invisible character between the two ps in RenderStepped. I don't know how it got there.


EDIT: It's a soft-hyphen. You've copied this from somewhere online that automatically put soft-hyphens in between some syllables, probably.


If you just re-type line 79, it should be fine.

0
Wait, whaaaat? Invisible Character? sigve10 94 — 8y
0
Ill try this as well and ill let you know if it worked Quote545 0 — 8y

Answer this question