Roblox Combat System

Hello,
I am currently developing a combat system,
The problem is I’m having a really hard time scripting and making ui’s
All i need is some tips om what to do next as I have no idea.
Because i can not find a single tutorial that can help me get further then where i am now.
So if you have any ideas on what to do next or a tutorial that can… Then feel free to leave a comment.

(With combat system i mean stuff like
Ui with controls (Items only)
Heavy attack
block
Normal attack
Run button.
And some type of stamina

Do you want to activate those things with buttons or when a key in the keyboard is pressed? (Or both)

It doesn’t really matter tbh
.,
As it is not really supossed to be a mobile game…

1 Like

Ah it’s okay I can explain both,
Method 1. Buttons : Add an ImageButton or TextButton (You can choose between those) then in a local script do:

local button = [button here]
button.MouseButton1Click:Connect(function()
--Do the attacks by firing a remote or whatever you wanted to do
end)

Method 1. Keys : In a local script put:

local UserInputService = game:GetService("UserInputService")
local key1 = Enum.KeyCode.Q --Whatever key you want
local key2 = Enum.KeyCode.E --Whatever key you want
--Add more keys if you want

UserInputService.InputBegan:Connect(function(keycode) --Detects when player presses a key
	if keycode == key1 then
		--Do the first attack by firing a remote or whatever you wanted to do
	elseif keycode == key2 then
		--Do the second attack by firing a remote or whatever you wanted to do
	end
end)

Hope this helps!

1 Like

This is going to contain a lot of if statements and rayscast (or magnitude) i think

1 Like

Thx, I’ll test it as soon as I can.

1 Like