- What do you want to achieve?
– I want to design the structure (where things gets placed on explorer) of my “elemental skill fight
game”
- What is the issue?
– Problem is although i can script basic skills i dont know how am i going to implement them with the rest of the games systems , for example i dont know when the player rolls their element and gets another one how am i gonna give the player new elements skills and i need to know how to make the structure because it affects the skill scripts im going to write , i dont really want to rewrite the skills codes again when i implement the “Structure” .
-
What solutions have you tried so far?
– Couldnt find much about it (trust me)
Im not asking for you to do that for me but i just need some examples and a explanation on how to work/do it . Sorry if my grammar is bad in any way . You can ask whatever you want .
1 Like
Well, to my knowledge most elemental skill fighting games give you tools in your inventory, along with that being how most fighting games are now.
What I would recommend is that anytime the user gets a new element, remove the tools from their inventory and add the new ones.
If you arent using tools, what you could do is any time a input is activated, for instance E does lets say a fire ball attack for example, you would probably fire a remote event to the server telling it to do a fire ball attack, instead you should fire the remote event to the server just telling it what input you pressed.
You would then lets say have a dictionary of every element, you would look inside of the element and find the input they pressed, and have an attack correspond with said attack, and example:
local Elements = {
Fire = {
E = {
Name = 'FireBall',
Attack = function()
print('Doing Fireball attack')
end
},
},
Ice = {
E = {
Name = 'Freeze',
Attack = function()
print('Doing Freeze attack')
end
},
},
}
local function UseMove(Element:String,Keycode) -- Element would be the players Element, and Keycode would be well, a keycode
local InputName = Keycode.Name
local Attack = Elements[Element][InputName] -- This gets the attack
print(`Using Ability: {Attack.Name}`)
Attack.Attack() -- Triggers the Attack Function
end
UseMove('Fire',Enum.Keycode.E)
-- After using this 2 things print.
'Using Ability: Fire' and 'Doing Fireball Attack'
This is personally how I would go about it, hope this helps a bit!
2 Likes
Thank you , this helped me to grasp the idea a lot better
1 Like