So as iv done in my 2 past posts, I’m releasing a lot of my old scripts or just scripts I wont ever use in general. Today I’m releasing something that I actually made pretty recently its this energy ball struggle that happens when 2 players have skills that clash each other. Here’s a preview of what it looks like. 2021-01-19 14-44-45 (streamable.com)
Now I know its not like a beam or what the title says, but you can take the information from here and easily apply it to a beam. Took me like 4 days to fully make this, if you look in serverscriptstorage you’ll see all of my failed attempts ;D Few side notes along with this beam clashing you also get a lock on and a ordered data store thatll show the top 50 players.
The reason I’m releasing this is because I really love these types of mechanics in games and I don’t see enough of them. I think mainly its too hard for people to figure out. I mean it took me 4 days to make this at least somewhat as decent as I did. I could improve it further, but I was just so tired of making the system by that point I just gave up lmao.
So yeah no credit is needed, please learn from this and put it in your future projects id love to see more clashing related games. Or games that just integrate this type of mechanic at least.
Music Voting System - Resources / Community Resources - DevForum | Roblox
Warcraft3 style camera - Resources / Community Resources - DevForum | Roblox
The trails were amazingly done, but I would suggest having all the effects done on the client for less latency.
Yeah it would of been better if the effects were client side, but I was having so much trouble doing that detection to make sure it was super direct. By time I actually got it to what I wanted it, I just gave up on the effects xd.
If you could explain the way the clashing system works for the script or like how to set it up or the steps for it to work, that would be much appreciated.
I’m pretty tired so I’m gonna explain this as simple as I can.
Alright so Client script forces you to lock on, once you do that it sets a bool value allowing you to activate the skill > sends to the server to create the skill, the server waits for the client to send information to the server telling it that you released the keydown > the server then shoots the skill and sends information to a function in the server saying after like 4 seconds have elapsed to delete the skill if it has not come into contact with another skill (I obviously had a bool to check for this) > so server sends information to client to start raycast loop which is thrown inside a spawnfunction to avoid lag and allow input to still be received from server. >Now if the skill didnt find another skill to clash with within those 4 seconds, it will be deleted from the game using game.Debris:AddItem and then send information to the client which will stop the loop and reset all bool values in the client script allowing you to start again. Now in the client script when I’m looping the raycast im also doing checks to see if the skill is still even active inside the workspace. This helps avoid errors and creating unnecessary lag > Now if the raycast comes back true, it will stop the loop inside the client and send that information over to the server as well as set a bool in both scripts allowing the clashing key to be pressed which is X in this case and prevent the skill from being deleted. > so now at this point both parts are stationary meaning not moving and waiting for input. > client can now push X which sends information to the server > Now in my original clashing I had just a value being added, but I wanted to make this like old roblox dbz clashing that was really fun. So all I did was took the general cframe values and added/subtracted from both parts. This is really easy if you don’t over analyze it. Basically you have both skills so you don’t have to exactly account for the other player as if you do something in 1 script for both parts itll happen for both players. So me taking the parts and adding cframe to push my skill forward and the other persons skill backwards when I pushed x > would essentially work if the other player pushed x. After that as positions are being changed I’m adding checks to see if the skill is touching the player. Now in here I check for both parts, but I only remove the skill for the player. Which doesn’t make sense now that I’m typing it, but basically I’m removing the skill for the specific player > so the skill that you spawned removes for you > I don’t attempt to remove both skills from 1 script. This way again it prevents errors. Attempting to do that would 100% throw errors and cause lag thats why I did it this way. I was on some big brained stuff when scripting this. But after I remove the skill the server sends to client to change all bools so the player can start the sequence again. Like I said this took me like 4 days if you’re attempting this for your first time it might take the same or using this, you might figure it out sooner. Hopefully. I hope no one has to endure the pain of making this system like I did.
Now if you can’t program and what I typed is a whole lot of nonsense to you, and you wanna customize it, but can’t because its throwing an error. In the server script theres a part that activates the cool little effects and what not. You can easily remove that part and most likely be able to change those effects to whatever you want. The systems not perfect by any means, but for a little clash release it sure will help you figure out how to get started to make something 10x better than this lol.
thank you, i really wanna use this for 2 game ideas of mine.
I’m happy you made this! Now I can use this in my Dragon Ball game >:D