A Simple Gun Script for Roblox Studio
Описание
I was getting an output error in the video b/c mouse.Target has to have a target in order to fire. Whoops xD. It should work fine as long as you're aiming the gun at a part.
If you're interested in scripting here's a video you should start on!
https://www.youtube.com/watch?v=BkYwRdCukZA&list=PLhieaQmOk7nIfMZ1UmvKGPrwuwQVwAvFa
Script:
swordTool.Equipped:Connect(function()
handle.Anchored = false
local character = swordTool.Parent
local hum = character.Humanoid
local AnimationTrack = hum:LoadAnimation(pose)
AnimationTrack:Play()
swordTool.Unequipped:Connect(function()
AnimationTrack:Stop()
end)
swordTool.Activated:Connect(function()
local AnimationTrack2 = hum:LoadAnimation(slash1)
AnimationTrack2:Play()
local connection
connection = unionPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage
print(damage, "damage done")
connection:Disconnect()
end
end)
swordTool.Deactivated:Connect(function()
AnimationTrack2:Stop()
end)
end)
end)
Рекомендуемые видео



















