Function Return Help? attempt to concatenate string with function
The error is on line 29, trying to set the name so in another script it can tell if the part touched anything. I am purposely doing this on the client side. If there is anyway I can do this inside this script keeping it on the client, let me know. Here is my local script, inside a tool:
01 | local gun = script.Parent |
02 | local ammo = game.ReplicatedStorage.NormalGunAmmo |
03 | local ActiveBullets = game.Workspace.ActiveBullets |
05 | local player = game.Players.LocalPlayer |
06 | local mouse = player:GetMouse() |
11 | local function number() |
12 | for i,v in pairs (ActiveBullets:GetChildren()) do |
18 | gun.Activated:Connect( function () |
19 | if debounce = = false then |
21 | local bullet = ammo:Clone() |
22 | bullet.CFrame = gun.Handle.CFrame |
24 | local BodyVelocity = Instance.new( "BodyVelocity" ,bullet) |
25 | BodyVelocity.P = Vector 3. new( 10000 , 10000 , 10000 ) |
26 | BodyVelocity.Velocity = mouse.Hit.LookVector * 100 |
28 | bullet.Parent = ActiveBullets |
29 | bullet.Name = "Bullet" ..number |
Error is in the title, and again, it occurs on line 29 trying to set the name, thanks!