Should this code be a LocalScript and be placed into StarterGui?
local player = game.Players.LocalPlayer local character = player.Character local rep = game:GetService("ReplicatedStorage") local uis = game:GetService("UserInputService") local jumpshot = rep.Animations:WaitForChild("jumpshot animation") local jumpshotanimation = character.Humanoid:LoadAnimation(jumpshot) local shoot = rep.Events:WaitForChild("shoot") local Basketball = game.ServerStorage.PracticeBall local ShotBall = false local Debounce = false uis.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.E and not Debounce and not ShotBall and character.Humanoid:FindFirstChild(Basketball) then ShotBall = true Debounce = false jumpshotanimation:Play() wait() Debounce = false ShotBall = false shoot:FireServer() end end)
Yes, it should be put in a local script since it is detecting the player's input. I'd put the script in local character scripts since it requires the character to be loaded to run.