You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want whenever the player presses R they’ll steal the ball from the other player making it go into the workspace.
What is the issue? Include screenshots / videos if possible!
Whenever I walk up to the other player to attempt to steal the ball…nothing happens. It stays in the other players inventory. Idk if it’s the scripting or whatnot.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
– Client Side
UIS.InputBegan:Connect(function(input, gameP)
if gameP then return end
if input.KeyCode == Enum.KeyCode.R then
if not player.Character:FindFirstChild(“Basketball”) then
print(player.Name… " Is Reaching")
StealDebounce = false
Reachanimation:Play()
Steal:FireServer()
wait(Reachanimation.Length)
StealDebounce = true
end
end
end)
– Server Side
Steal.OnServerEvent:Connect(function(player)
local Basketball = player.Character.Basketball
Basketball.Touched:Connect(function(hit)
if StealBall == false and Basketball.Parent ~= workspace and Basketball.Parent:FindFirstChild(“Humanoid”) and hit ~= player.Character:FindFirstChild(“RightHand”) then
Basketball.Parent = workspace
Basketball.Handle.Velocity = Vector3.new(2, 0, 0)
Basketball.Handle.RotVelocity = Vector3.new(0, 0, 10)
StealBall = true
end
StealBall = false
end)
end)
If this is your actual code, you’ll need to re-check and line up the correct ‘ends’ with the ifs, events, etc. It seems you’re missing some in some places.