• Hey! Register here to create your account, engage with the community, and talk about what is new!

How do i make a practical line that does damage like a magic wand?

Solution
When the player right clicks, do your checks (item check, cooldown check, etc.) then place a Select Players By Name, in the chest put a string with the value of %default and use the NOT arrow on the select block, this will insure that the raycast that we will do next doesn't hit the player, now place a Select Object -> Filter Selection -> Filter Ray, and in the first slot put a variable (preferably a LOCAL one), this will give us the hit location, let's call it "hitLoc", in the second slot put a Game Value -> Location Values -> Eye Location of the default player so the raycast starts from your eye, in the 3rd slot put a number for the distance, in the 4th slot put a number that will indicate the width, 0 should work...

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,260
Reaction score
357
When the player right clicks, do your checks (item check, cooldown check, etc.) then place a Select Players By Name, in the chest put a string with the value of %default and use the NOT arrow on the select block, this will insure that the raycast that we will do next doesn't hit the player, now place a Select Object -> Filter Selection -> Filter Ray, and in the first slot put a variable (preferably a LOCAL one), this will give us the hit location, let's call it "hitLoc", in the second slot put a Game Value -> Location Values -> Eye Location of the default player so the raycast starts from your eye, in the 3rd slot put a number for the distance, in the 4th slot put a number that will indicate the width, 0 should work fine and in the last slot put a number that will indicate how many players it can hit at max, 1 if you want it to hit only once, now the Selection target are the hit players, place a Player Action: Damage and shift-right click it and click on selection, that will damage the hit players and for the particles place a Particle Line, put the Eye Location game value in the first slot and the "hitLoc" variable in the 2nd slot and your particle ofc, now u should be ready to go!
 
Last edited:
Solution

strawspider

Forum adept
Emperor
Joined
Nov 5, 2022
Messages
194
Reaction score
7
When the player right clicks, do your checks (item check, cooldown check, etc.) then place a Select Players By Name, in the chest put a text called %default and use the NOT arrow on the select block, this will insure that the raycast that we will do next doesn't hit the player, now place a Select Object -> Filter Selection -> Filter Ray, and in the first slot put a variable (preferably a LOCAL one), this will give us the hit location, let's call it "hitLoc", in the second slot put a Game Value -> Location Values -> Eye Location of the default player so the raycast starts from your eye, in the 3rd slot put a number for the distance, in the 4th slot put a number that will indicate the width, 0 should work fine and in the last slot put a number that will indicate how many players it can hit at max, 1 if you want it to hit only once, now the Selection target are the hit players, place a Player Action: Damage and shift-right click it and click on selection, that will damage the hit players and for the particles place a Particle Line, put the Eye Location game value in the first slot and the "hitLoc" variable in the 2nd slot and your particle ofc, now u should be ready to go!
yes
 

JoshJootner

New member
Joined
Feb 5, 2024
Messages
7
Reaction score
0
When the player right clicks, do your checks (item check, cooldown check, etc.) then place a Select Players By Name, in the chest put a string with the value of %default and use the NOT arrow on the select block, this will insure that the raycast that we will do next doesn't hit the player, now place a Select Object -> Filter Selection -> Filter Ray, and in the first slot put a variable (preferably a LOCAL one), this will give us the hit location, let's call it "hitLoc", in the second slot put a Game Value -> Location Values -> Eye Location of the default player so the raycast starts from your eye, in the 3rd slot put a number for the distance, in the 4th slot put a number that will indicate the width, 0 should work fine and in the last slot put a number that will indicate how many players it can hit at max, 1 if you want it to hit only once, now the Selection target are the hit players, place a Player Action: Damage and shift-right click it and click on selection, that will damage the hit players and for the particles place a Particle Line, put the Eye Location game value in the first slot and the "hitLoc" variable in the 2nd slot and your particle ofc, now u should be ready to go!
the beam always goes to the same location no matter where i click??
 

JoshJootner

New member
Joined
Feb 5, 2024
Messages
7
Reaction score
0
it does, Eye Location does include the rotation of the player
i dont know then because its just going from the eye location to where the player spawned idk why i put in select object: "hitLoc", "Eye location (default)", 30, 0, 1. and then as for the player action (the particle line): "My particle", "Eye location (default)", "hitLoc" yet no matter where am looking or am currently at it just always goes to that direct spot, no variation.
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,260
Reaction score
357
i dont know then because its just going from the eye location to where the player spawned idk why i put in select object: "hitLoc", "Eye location (default)", 30, 0, 1. and then as for the player action (the particle line): "My particle", "Eye location (default)", "hitLoc" yet no matter where am looking or am currently at it just always goes to that direct spot, no variation.
are you sure the default entity is the player? can you try checking what the hutLoc is using send message? maybe there is a variable that has the wrong name
 
Top Bottom