RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"GetEquippedTool is not a valid member of Humanoid "Workspace.qw3rty_l0l.Humanoid""
It seems like you're getting an error because the function `GetEquippedTool` is not a valid member of the `Humanoid` class. Instead, you can check if the tool is equipped by using the `FindFirstChild` function on the player's character. Here is the corrected script: ```lua local ball = script.Parent.Parent local kickAnimation = script.Animation local toolName = "Shoot" -- replace this with your tool's name local proximityPrompt = script.Parent local function onProximityPromptTriggered(player) local character = player.Character if character then local humanoid = character:FindFirstChild("Humanoid") local tool = character:FindFirstChild(toolName) if tool and tool:IsA('Tool') and tool == player.Character:FindFirstChildWhichIsA('Tool') then if humanoid then print(player.Name .. " has triggered the proximity prompt with the correct tool equipped.") ball.Anchored = false proximityPrompt.Enabled = false humanoid:LoadAnimation(kickAnimation):Play() local direction = (character.HumanoidRootPart.CFrame.LookVector * 25) ball.Velocity = Vector3.new(direction.X, 10, direction.Z) player.Character.Humanoid.WalkSpeed = 0 wait(1.2) proximityPrompt.Enabled = true ball.Anchored = true player.Character.Humanoid.WalkSpeed = 16 end end end end proximityPrompt.Triggered:Connect(onProximityPromptTriggered) ``` This script checks if the player's character has a child of type 'Tool' and if that child is the same as the tool you specified. If both conditions are true, then the script will execute the rest of the code.