AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
How to make a gun in roblox studio12/25/2023 ![]() ![]() Mouse = :GetMouse()īullet.Velocity = * 1000Īnd that’s it, an basic method on how to fire a weapon on Roblox now its best advised to actually learn how to script on Roblox rather than just copy and paste code because you can addon more things to what you want to do related to scripting. click on your local script and copy this code down below:īullet = game.ReplicatedStorage:WaitForChild(“Part”) repeat step 2 but this time insert a part named “Handle” into the tool, make sure the name “Handle” has a capital H and make sure the handle is unanchored in the properties tab. When a tool is inserted into StarterPack, click “+” on tool and insert a LocalScript Go to Starter Pack in your Explorer and select “+” from there insert a Tool into your StarterPack. Mine is a bit advanced but it gives an example of what you could do with just ray-casting & user input.Now lets get started, after you’ve read through this tutorial your Handle part should be doing this: In addition to adding model descendants, you need to apply the following: 1. There are various ways to implement this, my game uses a cache-based weapon system which stores the guns for later use once they've been equipped once. A bow weapon like the Crossbow can include a realistic string and arms construction, as well as a visual arrow nocked to the string. 1 Being the time between current animation states & the animation track's initial playing state. Local AnimationTrack = Animator:LoadAnimation(Animation)ĪnimationTrack.Priority = - Change the priority.ĪnimationTrack:Play(.1). local Animation = Instance.new("Animation")Īnimation.AnimationId = "rbxassetid://0" - My animation ID. You can set cooldowns with a debounce variable and play animations on activation (depending on whether or not the cooldowns have completed). If you are making weapons, use UserInputService and WorldRoot:Raycast for handling mouse and ray-casting related operations.įor melee weapons I would suggest just sticking to the tool as you are already doing. Local rootPart = character:FindFirstChild("HumanoidRootPart") Local humanoid = character:FindFirstChildOfClass("Humanoid") ![]() Here are the two main functions you may want to consider trying for your weapon: local function fling(character) ![]()
0 Comments
Read More
Leave a Reply. |