local WS = game:GetService("Workspace") -- Defines Varibles
local SBE = game.ReplicatedStorage:FindFirstChild("SnowBallEvent")
local SBT = game.ReplicatedStorage:FindFirstChild("SnowBallThrowEvent")
local SB = game.ServerStorage:FindFirstChild("Snowball")
local TSB = game.ServerStorage:FindFirstChild("ThrowableSnowball")
local function CreateSnowball(player) -- Adds or shows an accessory
local SP = WS:FindFirstChild(player.Name)
local snowball = SP:FindFirstChild("Snowball")
if snowball then
snowball.Handle.Transparency = 0 -- Shows the Accessory
else
SP.Humanoid:AddAccessory(SB:clone()) -- Adds an accessory to the players hands
end
end
local function ThrowSnowball(player,power) -- Creates a snowball and lanuches it
local SP = WS:FindFirstChild(player.Name)
local STSB = TSB:clone()
local SPM = STSB:GetMass()
local Force = SPM * power -- Mass times fifty to sixty
local truepower = Vector3.new(SP.Head.CFrame.LookVector.x * Force/0.75, Force * 2.5,SP.Head.CFrame.LookVector.z * Force/0.75) -- Calcates force
STSB:SetAttribute("PlayerName", player.Name) -- Sets an Attribute that is used in the hitbox (The name of the player who threw it)
STSB.Parent = game.Workspace -- Puts it in the workspace
STSB.Position = SP.Snowball.Handle.Position
SP.Snowball.Handle.Transparency = 1 -- Hides the accessory
STSB:ApplyImpulse(truepower) -- Lanuches a snowball
end
SBE.OnServerEvent:Connect(CreateSnowball)
SBT.OnServerEvent:Connect(ThrowSnowball)
Its way below 1000 and that wouldn’t fix it. Its something to do with the players direction. 6.7 * 60 is around 402 by the way and works fine while not near certain directions.
It’s probably cuz ur adding too much y power, try instead of multiplying it by 2.5 dividing by something that increases as the force is greater, like Force/(Force/10) or idk, i never used this type of force applying, i am very much used to BodyForce/BodyVelocity
You can try adding BodyVelocity to the snowball instead of using :ApplyImpulse(), however I don’t guarantee that is the solution.
Also I’m pretty sure if you want to make a somewhat accurate throwable snowball you’d need to get the position of their cursor, similar to what is shown on this page: Mouse | Roblox Creator Documentation
I didn’t notice I made a mistake in my first reply, you don’t have to use BodyVelocity in order to boost the projectile and you don’t need the mouse position either, sorry!
Anyway, in order to get more knowledge about how throwing something works I checked the official Roblox snowball gear. It’s a little outdated but it works perfectly. As turns out, it used BodyForce to boost the projectile.
Once again, I’m sorry for the confusion I’ve made up. I attached a picture that contains the piece of code that was inside the snowball gear to clear out the confusion.