https://youtube.com/shorts/cx04BWKtK0M?si=3hg6NilxcLVG2uw1📸 Сегодня утром опубликовал короткий ролик в обучающем формате!
👀 Посмотрите, оцените, напишите пожелания в коментариях - а нужен ли такой формат? И если нужен, то предлагайте темы, которые можно уместить в 1 минуту.
Оценили, с какой скоростью я печатаю скрипты?⚡️⚡️⚡️
-- локальный скрипт
local tool = script.Parent
local remoteEvent = tool.RemoteEvent
tool.Equipped:Connect(function (mouse)
mouse.Button1Down:Connect(function ()
remoteEvent:FireServer(mouse.Hit.Position)
end)
end)
-- серверный скрипт
local tool = script.Parent
local remoteEvent = tool.RemoteEvent
local handle = tool.Handle
local sound = handle.pew
remoteEvent.OnServerEvent:Connect(function (player, mouseHitPosition)
sound:Play()
local bullet = Instance.new("Part")
bullet.Shape = Enum.PartType.Ball
bullet.Material = Enum.Material.Neon
bullet.Color = Color3.new(1, 0, 0)
bullet.Size = Vector3.new(1,1,1)
bullet.CanCollide = false
bullet.Parent = workspace
bullet.CFrame = CFrame.new(handle.Position, mouseHitPosition)
bullet.AssemblyLinearVelocity = bullet.CFrame.LookVector * 500
bullet.Touched:Connect(function (hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
if hit.Parent.Name ~= tool.Parent.Name then
if bullet.CanTouch == true then
bullet.CanTouch = false
humanoid:TakeDamage(math.random(15,25))
bullet:Destroy()
end
end
end
end)
game:GetService("Debris"):AddItem(bullet, 3)
end)