Professional Documents
Culture Documents
ShootServer LUA
ShootServer LUA
--------Main Events----------
local Events = Tool:WaitForChild("Events")
local ShootEvent = Events:WaitForChild("ShootRE")
local CreateBulletEvent = Events:WaitForChild("CreateBullet")
pcall(function()
script.Parent:FindFirstChild("ThumbnailCamera"):Destroy()
script.Parent:WaitForChild("READ ME"):Destroy()
function CreateBullet(bulletPos)
if not workspace:FindFirstChild("BulletFolder") then
local BulletFolder = Instance.new("Folder")
BulletFolder.Name = "Bullets"
end
local bullet = Instance.new('Part', workspace.BulletsFolder)
bullet.FormFactor = Enum.FormFactor.Custom
bullet.Size = Vector3.new(0.1, 0.1, 0.1)
bullet.BrickColor = BrickColor.new("Black")
bullet.Shape = Enum.PartType.Block
bullet.CanCollide = false
bullet.CFrame = CFrame.new(bulletPos)
bullet.Anchored = true
bullet.TopSurface = Enum.SurfaceType.Smooth
bullet.BottomSurface = Enum.SurfaceType.Smooth
bullet.Name = 'Bullet'
DebrisService:AddItem(bullet, 2.5)
CreateBulletEvent.OnServerEvent:Connect(function(plr, pos)
CreateBullet(pos)
end)