#I wanna make a football have more power and make it smoother after it bounces on the ground
1 messages · Page 1 of 1 (latest)
Whats this?
me telling you that your help request is fucking useless
cuz u havent provided shit
What do i need to provide then
You tell me
What you need
maybe fucking anything
To put it more politely, we need to see the code you made so we can help you.
Without code we can't quite tell what you might be doing wrong, or how the code can change to address your issue
One second
Ill send it
Wow i explained abit wrong but ok
@coral zodiac
Tell me if u need gui
bud, no. Copy & paste that in Discord and format it like it describes in the post guidelines.
That's very difficult to read.
local ball = script.Parent
function onTouched(otherPart)
local character = otherPart.Parent
local humanoid = character:FindFirstChild("Humanoid")
local hrp = character:FindFirstChild("HumanoidRootPart")
if humanoid and hrp then
local player = game.Players:GetPlayerFromCharacter(character)
if not player then return end
local ballStatus = player:GetAttribute("BallStatus") or "H" -- default to H
local forceDirection = Vector3.new(hrp.CFrame.LookVector.X, 0, hrp.CFrame.LookVector.Z).Unit
local forceMagnitude
if ballStatus == "L" then
forceMagnitude = 30
ball.Velocity = forceDirection * forceMagnitude
elseif ballStatus == "H" then
forceDirection = Vector3.new(hrp.CFrame.LookVector.X, 1, hrp.CFrame.LookVector.Z).Unit
forceMagnitude = 35
ball.Velocity = forceDirection * forceMagnitude
end
if player then
game.ServerStorage.LastBallTouch.Value = player.Name
end
end
end
ball.Touched:Connect(onTouched)
Just increase the forceMagnitude to make a kick stronger
That makes it go higher
I want it like
To go further
You get it
increase the Y axis of the force direction
or decrease it
Okay let me try
@coral zodiac ok so can u help me with the last parts too
Btw i used 2 scripts for the ball
local ball = script.Parent
local function onTouched(hit)
local character = hit.Parent
local humanoid = character and character:FindFirstChild("Humanoid")
local hrp = character and character:FindFirstChild("HumanoidRootPart")
if humanoid and hrp then
-- Get the direction from the player to the ball
local playerToBall = (ball.Position - hrp.Position).Unit
-- Get the player's facing direction
local playerLook = hrp.CFrame.LookVector.Unit
-- Dot product to determine if player is facing the ball (front) or away (back)
local dot = playerToBall:Dot(playerLook)
local forceDirection
if dot > 0 then
-- Player is facing the ball: hit with front, push ball away from player (forward)
forceDirection = playerLook
else
-- Player's back is to the ball: hit with back, push ball toward player (backward)
forceDirection = -playerLook
end
-- Apply velocity to the ball
local forceMagnitude = 40 -- Adjusted for more natural movement
ball.AssemblyLinearVelocity = forceDirection * forceMagnitude
end
end
ball.Touched:Connect(onTouched)
this is the other script
Help with the smoother bouncing?
Yes
It goes to a random way when bouncing
I wanna remove the bouncing actually
You'd have to mess with the physics properties of the floor and ball itself
it isn't really a scripting thing
Well it might be the balls meshpart but im not good at making meshparts
Does it happen when you use a basic sphere part?