#Soccer Ball Kicking System
31 messages · Page 1 of 1 (latest)
So just create a local function on the StarterPlayerScript
I mean a local script
Define the variables to do the animation to do the shoot to goal
It’s fine i don’t need money because if I do that then others will ask me to pay to script then if the game flops aka fail they why pay but at least it’s good to learn
I’m just saying it’s ok to learn without paying
** You are now Level 1! **
💀
im going to create a simple script to handle the Ball and Shoot will a script example then update it
local Player = game.Players.LocalPlayer
local function Handler(goal)
-- script to handle the animation 1
end
local Mouse = Player:GetMouse()
local function Handler1()
--script to handle Animation2
end
local function Target(goal)
Animation2 = goal-- To Update the Animation
Handler1(goal)
end
Mouse.Button1Down:Connect(function()
Handler(Animation1)
end)
Mouse.Button1Up:Connect(function()
Target(Aniation2)
end)``` a small handler but u would need to modify the Function since this is a example
thats what i said since u need to modify it to handle the Animation
thats why i said the goal is the handler whil the Tartget(Animation2)
will update it based on Goal
just make a TextButton for now since im only do scripts for pc and Consol
but im still learning
This tutorial will show you how to make your game mobile friendly on Roblox by using ContextActionService to create buttons for mobile users to press. It's very important to make your Roblox game mobile friendly. By adding mobile support you will gain more robux and more likes because players will be able to play your game properly and therefore...
oh im still learning since once a year i restart from scratch so i dont remember that much
** You are now Level 2! **
you cant really be spoonfed in a help channel/forum
i recommend learning how to script like how Not_DevHelp suggested
yes
#👷︱for-hire #💵︱hiring
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://123456789" -- replace this with the actual ID of your power up animation
local track = humanoid:LoadAnimation(animation)
track.Priority = Enum.AnimationPriority.Action
local isPoweredUp = false
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then
track:Play()
isPoweredUp = true
end
end)
game:GetService("UserInputService").InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Space then
track:Stop()
isPoweredUp = false
end
end)
-- Kicking system:
local foot = character:WaitForChild("Left Foot")
local kickAnim = Instance.new("Animation")
kickAnim.AnimationId = "rbxassetid://987654321" -- replace this with the actual ID of your kick animation
local kickTrack = humanoid:LoadAnimation(kickAnim)
kickTrack.Priority = Enum.AnimationPriority.Action
local kick = Instance.new("Part")
kick.Name = "Kick"
kick.Parent = character
kick.Size = Vector3.new(0.2, 0.2, 0.2)
kick.Position = foot.Position
kick.Anchored = true
local kickWeld = Instance.new("Weld")
kickWeld.Parent = kick
kickWeld.Part0 = foot
kickWeld.Part1 = kick
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and not isPoweredUp then
kickTrack:Play()
kick.Anchored = false
wait(0.2)
kick.Anchored = true
end
end)```
a example for computer now a Phone or tablet
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://123456789" -- replace this with the actual ID of your power up animation
local track = humanoid:LoadAnimation(animation)
track.Priority = Enum.AnimationPriority.Action
local isPoweredUp = false
game:GetService("UserInputService").TouchStarted:Connect(function(touch)
track:Play()
isPoweredUp = true
end)
game:GetService("UserInputService").TouchEnded:Connect(function(touch)
track:Stop()
isPoweredUp = false
end)
-- Kicking system:
local foot = character:WaitForChild("Left Foot")
local kickAnim = Instance.new("Animation")
kickAnim.AnimationId = "rbxassetid://987654321" -- replace this with the actual ID of your kick animation
local kickTrack = humanoid:LoadAnimation(kickAnim)
kickTrack.Priority = Enum.AnimationPriority.Action
local kick = Instance.new("Part")
kick.Name = "Kick"
kick.Parent = character
kick.Size = Vector3.new(0.2, 0.2, 0.2)
kick.Position = foot.Position
kick.Anchored = true
local kickWeld = Instance.new("Weld")
kickWeld.Parent = kick
kickWeld.Part0 = foot
kickWeld.Part1 = kick
game:GetService("UserInputService").TouchStarted:Connect(function(touch)
if not isPoweredUp then
kickTrack:Play()
kick.Anchored = false
wait(0.2)
kick.Anchored = true
end
end)```
Yes but make sure it’s a local