Description How to make working gun in studio lite roblox Bacon_boy 7 Likes 133 Views Nov 25 2024 Script 👇put in tool 🔫 local tool = script.Parent local handle = tool:WaitForChild("Handle") -- The part of the tool that is held by the player local rocketSpeed = 100 -- The speed at which the rocket travels local rocketDamage = 50 -- The damage dealt when the rocket hits a player -- Function to create and fire the rocket local function fireRocket() local character = tool.Parent -- The character using the tool local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") if not humanoidRootPart then return end -- Create the rocket part local rocket = Instance.new("Part") rocket.Size = Vector3.new(1, 1, 3) -- Change this to the size of your rocket rocket.Shape = Enum.PartType.Cylinder rocket.Color = Color3.fromRGB(255, 0, 0) -- Red color for the rocket rocket.Position = handle.Position + (handle.CFrame.LookVector * 2) -- Spawn the rocket just in front of the tool rocket.Anchored = false rocket.CanCollide = true rocket.Parent = workspace -- Make the rocket move in the direction the tool is pointing local bodyVelocity = Instance.new("BodyVelocity") bodyVelocity.MaxForce = Vector3.new(100000, 100000, 100000) -- Max force to move the rocket bodyVelocity.Velocity = handle.CFrame.LookVector * rocketSpeed -- Direction and speed bodyVelocity.Parent = rocket -- Rocket hit detection rocket.Touched:Connect(function(hit) local otherCharacter = hit.Parent local humanoid = otherCharacter:FindFirstChild("Humanoid") if humanoid and otherCharacter ~= character then -- Damage the player humanoid:TakeDamage(rocketDamage) -- Destroy the rocket rocket:Destroy() end end) -- Destroy the rocket after a few seconds if it doesn't hit anything game:GetService("Debris"):AddItem(rocket, 5) end -- When the player clicks, fire the rocket tool.Activated:Connect(fireRocket
How to make a part that gives cash
I can make comment my yutube
@StudioRobloxprojek u can make ight
Comment a totorial idea 💡 and I'll pin you
tutorial on a working swing pls?!❤
Description
How to make working gun in studio lite roblox
Bacon_boy
7
Likes
133
Views
Nov 25
2024
Script 👇put in tool 🔫
local tool = script.Parent
local handle = tool:WaitForChild("Handle") -- The part of the tool that is held by the player
local rocketSpeed = 100 -- The speed at which the rocket travels
local rocketDamage = 50 -- The damage dealt when the rocket hits a player
-- Function to create and fire the rocket
local function fireRocket()
local character = tool.Parent -- The character using the tool
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then return end
-- Create the rocket part
local rocket = Instance.new("Part")
rocket.Size = Vector3.new(1, 1, 3) -- Change this to the size of your rocket
rocket.Shape = Enum.PartType.Cylinder
rocket.Color = Color3.fromRGB(255, 0, 0) -- Red color for the rocket
rocket.Position = handle.Position + (handle.CFrame.LookVector * 2) -- Spawn the rocket just in front of the tool
rocket.Anchored = false
rocket.CanCollide = true
rocket.Parent = workspace
-- Make the rocket move in the direction the tool is pointing
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(100000, 100000, 100000) -- Max force to move the rocket
bodyVelocity.Velocity = handle.CFrame.LookVector * rocketSpeed -- Direction and speed
bodyVelocity.Parent = rocket
-- Rocket hit detection
rocket.Touched:Connect(function(hit)
local otherCharacter = hit.Parent
local humanoid = otherCharacter:FindFirstChild("Humanoid")
if humanoid and otherCharacter ~= character then
-- Damage the player
humanoid:TakeDamage(rocketDamage)
-- Destroy the rocket
rocket:Destroy()
end
end)
-- Destroy the rocket after a few seconds if it doesn't hit anything
game:GetService("Debris"):AddItem(rocket, 5)
end
-- When the player clicks, fire the rocket
tool.Activated:Connect(fireRocket