Моя игра: www.roblox.com/games/14076248...
1 скрипт: script.Parent.Activated:Connect(function()
local mouse = game.Players.LocalPlayer:GetMouse() -- Мышь локального игрока
script.Parent.Fire:FireServer(mouse.Target) -- Если курсор на игроке то если выстрелить то пуля поподёт в игрока
end)
script.Parent.Activated:Connect(function()
script.Sound:Play() -- Проигравание звука
end)
2 скрипт: script.Parent.Fire.OnServerEvent:Connect(function(plr, target)
if target.Parent.Humanoid then -- если цель гуманоид то
target.Parent.Humanoid:TakeDamage(25) -- Гуманоиду будет наносится урон
end
end)
3 скрипт: local human = game.Players.LocalPlayer.Character.Humanoid
script.parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
animation = human:LoadAnimation(script.Parent.Animation)
animation.Priority = Enum.AnimationPriority.Action
animation:Play()
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)
Подпишись и поставь лайк!
Негізгі бет Ойындар Как сделать оружие в роблокс студио с анимацией и звуком!
Пікірлер: 25