script.Parent.Touched:Connect(function(Hit)
if Hit.Parent.Name == "BALLS" then
local Character = workspace.CHARACTERS:FindFirstChild(Hit.Name)
local BodyVelocity = Instance.new("BodyVelocity",Hit)
local multiplier = 100 -- Change this amount.
local lookVector = Character.HumanoidRootPart.CFrame.lookVector
BodyVelocity.P = 0
BodyVelocity.MaxForce = lookVector * multiplier
BodyVelocity.Velocity = lookVector * multiplier
end
end)
I will try this in 10ish minutes when I get back on. Which script are you referring to when you say âIs your script inside of ball?â? If you mean the booster script, it is one script that controls all the boost pads, coins, spinners, etc. in ServerScriptService.
It still isnât working. The BodyVelocity is created in the ball and everything but the ball remains unaffected. I am using this system by EgoMoose as the ground work of my game. Maybe something in it is preventing boosts from working?
I meant script that you showed.
I ask this because if so, your code should look like this:
script.Parent.Touched:Connect(function(Hit)
if Hit.Name == "YOUR JUMP PAD NAME HERE" then
local Character = workspace.CHARACTERS:FindFirstChild("PATH TO PLAYER'S CHARACTER") -- as argument you should pass player's Character, not a boost pad
local BodyVelocity = Instance.new("BodyVelocity",Hit)
local multiplier = 100 -- Change this amount.
local lookVector = Character.HumanoidRootPart.CFrame.lookVector
BodyVelocity.P = 0
BodyVelocity.MaxForce = lookVector * multiplier
BodyVelocity.Velocity = lookVector * multiplier
end
end)
Oh yea no it is not inside of the ball, it is a script in ServerScriptService. I really think that the ball system EgoMoose created is affecting the ballâs ability to be affected by BodyVelocitys, but I cannot figure out how to fix this.
Then is ball has playerâs Ńharacter name? This code executes every time something touched boost pad and if hit.Parent.Name equals to âBALLSâ(probably a folder where all balls are) then you are trying to find character, whose ball touched boost pad, which means ballâs name should be same as characterâs name.
I found out that I can make a bool inside of the ball to toggle when they hit the boost pad, then in the module by EgoMoose I can check if that is true, if it is set the speed higher, if not set it default.