I am working on a game that’s incorporates wizard spells in it. The game I intend to make will have spells that come from the tip of the wand when a player says a specific incantation in the chat. For example; The player says “Stupefy” and then clicks on another player, the spell leaves the tip of the wand and shoot she towards the person they clicked. Any ideas how I can do this?
Here is a game that incorporates the spell technique I intend to use; Wizard Life - Roblox
Maybe have the game check what the player chatted then store what the player said in a StringValue and have your wand script use an if statement to check if the StringValue’s Value is equal to a spell name. Then in the if statement is where you put the spells code as well as set the StringValue’s Value to Nothing. (Note it will be a little bit more complex but this should be a good starter example to help you)
@BFISH4 So, I speciallize in the creation of such systems, and what version you might want to start looking at, is a very basic version. I can make very basic system for you, just so you get the feel, because all wands that are made in the HP(Harry Potter) genre follow the same configuration. Local spell recognition to load the spell, then a remotes fired if the spell is loaded when the mousebutton1 is clicked, and then the remote fires a fuction that creates a projectile and cframes it in loops in the direction of the endPosition(Mouse.Hit) from the startPosition(Wand tip). Raycasting is used in the loop to detect hit. It is not too difficult when you get used to it, but you will need to be familiar with raycasting and remotes. As far as the zig zag goes, that is in the maths of the cframe. In order to make it a projectile you generate a random position based off of the “Zig zag amount value” and then send the projectile in this loop.
I have some examples of very simple versions of this
Game with wand projectile example:
Check out Stupid Sticks. It’s one of the millions of unique, user-generated 3D experiences created on Roblox.
gif examples:
https://gyazo.com/b62ad1228033e260a81d28e93eb2f91d
https://gyazo.com/df8998864320676306ed40c41c818971
Also, trails are used for the traveling effect on the projectile or parts if you want an actual and fully raycasted effect
PS. you may find this response sent by me to answer similar questions by different folks.
Thank you SO much sir! I will check it out! I hope to speak with you more about it as soon as possible. However, the game appears to be private, I cannot access it.
I have a question, As you know, you can only cast one spell at once, how would you load a spell and have only one spell loaded at a given time?
Not sure what you are asking, the system already does that?