Expected <eof> Near 'end'?
Hello again, i have this script and the error says
"<eof> got 'end'
What do i do now?
01 | local gun = workspace.Turret.Gun |
02 | local originpoint = gun.CFrame.p |
04 | script.Parent.Radar.Radar.Touched:connect( function (plr) |
05 | if plr.Parent:IsA( "Model" ) and plr.Parent:FindFirstChild( "Humanoid" ) and game.Players.LocalPlayer.Character:FindFirstChild( "Head" ) then |
06 | script.Parent.Gun.alert:Play() |
07 | local ignore = { script.Parent,game.Players(plr.Parent.Name) } |
08 | local ray = Ray.new(originpoint,plr.Parent.Head.CFrame.p.Unit* 100 ) |
09 | local gun,position = workspace:FindPartOnRayWithIgnoreList(ray,ignore, false , true ) |
11 | local beam = Instance.new ( "Part" ) |
12 | beam.BrickColor = BrickColor.Red() |
13 | beam.Material = "Neon" |
14 | beam.Transparency = 50 |
17 | beam.CanCollide = false |
19 | local Distance = (script.Parent.Gun.CFrame.p-Position).magnitude |
20 | local distance = Distance/ 8 |
22 | beam.Size = Vector 3. new(. 15 ,. 15 ,distance) |
23 | beam.CFrame = CFrame.new(script.Parent.Gun.CFrame.p,Position)*CFrame.new( 0 , 0 ,-distance/ 2 ) |
26 | until distance = = Distance* 2 |
28 | beam.Touched:connect( function (hit) |
29 | if hit.Parent:IsA( "Model" ) and hit.Parent:FindFirstChild( "Humanoid" ) then |
30 | local human = hit.Parent:FindFirstChild( "Humanoid" ) |
31 | human:TakeDamage( 10 ^ 308 ) |
38 | game:GetService( "Debris" ):AddItem(beam,. 1 ) |
48 | game:GetService( "Debris" ):AddItem(beam,. 1 ) |