How do I code attacks similar to Skylanders?

Godot Version

v4.7.1.rc1.official [17e2686e0]

Question

How do I code attacks my playable characters similars to Skylanders using GDScript?

Skylanders SWAP Force PS4 Instruction Manual

When asking questions, you need to be more specific. Assume we have no idea what skylanders are, show us an example, show us what you made so far, how you tried to solve your issue, and what roadblocks you faced.

Seems pretty standard, press button, play animation, turn on hit boxes. Have you tried any tutorials on creating attacks? basic combat?

I’m a beginner

If you need my test player code, here it is.

extends CharacterBody3D

const health = 100
const SPEED = 5.0
const JUMP_VELOCITY = 5.0

func _physics_process(delta: float) -> void:
	
	if not is_on_floor():
		velocity += get_gravity() * delta

	if Input.is_action_just_pressed("jump") and is_on_floor():
		velocity.y = JUMP_VELOCITY


	var input_dir := Input.get_vector("left", "right", "forward", "backward")
	var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
	if direction:
		velocity.x = direction.x * SPEED
		velocity.z = direction.z * SPEED
	else:
		velocity.x = move_toward(velocity.x, 0, SPEED)
		velocity.z = move_toward(velocity.z, 0, SPEED)
	move_and_slide()
	
	if input_event.is_action_just_pressed("primary attack"):
		#play animation

I only mean that there are certainly resources out there, what have you looked at so far? Do you have code and if so does it produce the desired result? What result does it produce? Do you have character attack animations already made?

still need help

Just find a tutorial for attacks and make a different type of attack for each button

Your question is too broad to answer and too vague to provide pointed replies. That’s why everybody is telling you to look up tutorials-- as it stands, a complete answer to your question would look like a several hour long lecture or possibly even a course. Nobody is going to put in that much effort, especially if you can’t be bothered to answer people’s questions.