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

Expected <eof> Near 'end'?

Asked by 5 years ago

Hello again, i have this script and the error says "<eof> got 'end'

What do i do now?

local gun = workspace.Turret.Gun
local originpoint = gun.CFrame.p

script.Parent.Radar.Radar.Touched:connect(function(plr)
    if plr.Parent:IsA("Model") and plr.Parent:FindFirstChild("Humanoid") and game.Players.LocalPlayer.Character:FindFirstChild("Head") then
    script.Parent.Gun.alert:Play()
    local ignore = {script.Parent,game.Players(plr.Parent.Name)}
    local ray = Ray.new(originpoint,plr.Parent.Head.CFrame.p.Unit*100)
    local gun,position = workspace:FindPartOnRayWithIgnoreList(ray,ignore,false,true)

    local beam = Instance.new ("Part")
    beam.BrickColor = BrickColor.Red()
    beam.Material = "Neon"
    beam.Transparency = 50
    beam.Anchored = true
    beam.Locked = true
    beam.CanCollide = false

    local Distance = (script.Parent.Gun.CFrame.p-Position).magnitude
    local distance = Distance/8
    repeat
        beam.Size = Vector3.new(.15,.15,distance)
        beam.CFrame = CFrame.new(script.Parent.Gun.CFrame.p,Position)*CFrame.new(0,0,-distance/2)
        distance = distance*2
        wait (0.01)
    until distance == Distance*2

    beam.Touched:connect(function(hit)
        if hit.Parent:IsA("Model") and hit.Parent:FindFirstChild("Humanoid") then
            local human = hit.Parent:FindFirstChild("Humanoid")
        human:TakeDamage(10^308)


        end

    end)

    game:GetService("Debris"):AddItem(beam,.1)






    end
end)

    game:GetService("Debris"):AddItem(beam,.1)






    end
end)
0
You have an extra end like i told you before. stop deleting your questions User#5423 17 — 5y
0
well then were is it Theroofypidgeot 21 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Try if this works. If it works, mark my answer as correct

local gun = workspace.Turret.Gun
local originpoint = gun.CFrame.p

script.Parent.Radar.Radar.Touched:connect(function(plr)
    if plr.Parent:IsA("Model") and plr.Parent:FindFirstChild("Humanoid") and game.Players.LocalPlayer.Character:FindFirstChild("Head") then
    script.Parent.Gun.alert:Play()
    local ignore = {script.Parent,game.Players(plr.Parent.Name)}
    local ray = Ray.new(originpoint,plr.Parent.Head.CFrame.p.Unit*100)
    local gun,position = workspace:FindPartOnRayWithIgnoreList(ray,ignore,false,true)

    local beam = Instance.new ("Part")
    beam.BrickColor = BrickColor.Red()
    beam.Material = "Neon"
    beam.Transparency = 50
    beam.Anchored = true
    beam.Locked = true
    beam.CanCollide = false

    local Distance = (script.Parent.Gun.CFrame.p-Position).magnitude
    local distance = Distance/8
    repeat
        beam.Size = Vector3.new(.15,.15,distance)
        beam.CFrame = CFrame.new(script.Parent.Gun.CFrame.p,Position)*CFrame.new(0,0,-distance/2)
        distance = distance*2
        wait (0.01)
    until distance == Distance*2

    beam.Touched:connect(function(hit)
        if hit.Parent:IsA("Model") and hit.Parent:FindFirstChild("Humanoid") then
            local human = hit.Parent:FindFirstChild("Humanoid")
        human:TakeDamage(10^308)


        end

    end)

    game:GetService("Debris"):AddItem(beam,.1)






    end
end)

    game:GetService("Debris"):AddItem(beam,.1)


Ad

Answer this question