Привет! Вы просили и я сделал новый гайд по рб студио. Если видео было тебе полезно то подпишись на канал.
Скрипты:
local CanThrow = true
script.Parent.Throw.OnServerEvent:Connect(function(player, mouseHit)
if CanThrow == true then
CanThrow = false
wait(0.2)
script.Parent.ThrowSound:Play()
local touched = false
local deb = false
local knifeClone = script.Parent.Handle:Clone()
knifeClone.CanCollide = false
knifeClone.Anchored = true
knifeClone.Parent = workspace
knifeClone.Name = "ThrownKnife"
knifeClone.Position = script.Parent.Handle.Position
knifeClone.CFrame = CFrame.new(knifeClone.Position, mouseHit.Position)
knifeClone.Velocity = knifeClone.CFrame.LookVector * 100
knifeClone.Transparency = 0
knifeClone.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and deb == false and hit.Parent.Name ~= script.Parent.Parent.Name and touched == false then
if hit.Parent.Humanoid.Health знак больше 0 then
deb = true
hit.Parent.Humanoid.Health -= 100 -- урон
knifeClone:Destroy()
touched = true
wait(1)
CanThrow = true
touched = false
deb = false
end
end
end)
if touched == false then
local distance = 200 -- дальность броска
local tween = game:GetService("TweenService"):Create(knifeClone, TweenInfo.new(1, Enum.EasingStyle.Sine), {Orientation = Vector3.new(-1080, knifeClone.Orientation.Y, knifeClone.Orientation.Z)})
local tween2 = game:GetService("TweenService"):Create(knifeClone, TweenInfo.new(1, Enum.EasingStyle.Sine), {CFrame = knifeClone.CFrame + (knifeClone.CFrame.LookVector * distance)})
tween:Play()
tween2:Play()
tween2.Completed:Wait()
if touched == false then
knifeClone:Destroy()
CanThrow = true
touched = false
end
end
end
end)
Local script:
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local mouse = player:GetMouse()
script.Parent.Activated:Connect(function()
local mouseHit = mouse.Hit
script.Parent.Throw:FireServer(mouseHit)
end)
Ссылочки:
Наш тгк:https://t.me/linextgtipa
Закинь деняк на покушать пжжж:
https://www.donationalerts.com/r/line...
Watch video КАК СДЕЛАТЬ МЕТАНИЕ НОЖА В ROBLOX STUDIO | ПЕРВЫЙ ТУТОР НА РУССКОМ online without registration, duration hours minute second in high quality. This video was added by user Linex 12 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 591 once and liked it 26 people.