There are tutorials on the devforum and youtube for that!
I have never scripted VFX before, nor do I have any intentions to script some VFX. But if I ever wanted to script some, this will definitely be my go to tutorial. Good job big man!!
Awesome! Now I can make some VFX scripts! Helpful tutorial.
I do not suggest using Debris as a method of getting rid of instances, there have been major concerns about its performance, so it’s recommended that you wrap it in a thread instead.
I’ll try looking into it, thanks for the suggestion
So basically the only difference is that you relay back to the client with the cframe and position for tween. But I don’t understand what that clone was for on the server side. I think the line was Hitbox:Clone()
Hi, are you using this? @kinglol123468 's hitbox module. … the latest post says it is laggy and also the dudes account is suspended…
Do you have any other suggesting , I am looking for something that will detect player hits of small parts that explode and the parts move around…
Thanks
Dosent mean that the module is bad
Im not experiencing this issue at all, it’s still 61 fps
It doesn’t take much to make a simple hit detection for projectiles, all you have to do is raycast from the last position to the current position and see if the raycast hit something, if it does then damage, replicate, etc.
I love this guide. it’s been extremely helpful I can’t wait for a part 2!
I’m waiting for part 2, this is so good we need part 2 !!
Can’t wait for part 2, such a great tutorial!
I just discovered this post, and… woah… I have been doing everything so wrong…
I do got a few questions though…
Doing the tween fireball from the client is easy-ish, but how would I make an effect work with a load of emitters?
What would be the best way to structure the magic system? Having a remote event for each magic attack does not sound practical.
How would you do a beam attack, two issues (kinda), detecting when the beam “Stops” and also, constantly updating the beams ending position.
Thanks for posting this, I can’t wait for part 2.
(I will be checking daily)
For Question 2, I’d rather have a remote for each class (if you have). So for example, 1 remote for Fire Magic and 1 remote for Water Magic.
I use it, trust me it’s not laggy at all.
Yeah doesn’t mean the module’s bad
Would this be able to cope with multiple people at once?
I tried making raycasting guns ages ago, and I made a machine gun, but only one person could fire at once…
I swapped to making the visuals to the client and it works, but I am just wandering is this efficent?
Thanks for your responce, sorry if I am getting off topic here.
Yes, it would. If only one person could fire at once then there’s something wrong with your code.
There are 2 ways I would approach this.
-
Using a remote event for each type of “magic” and not “magic attack” like how @ATrashScripter mentioned
-
Using only one remote for every magic, however this will require a handful of experience with modules for efficiency
Hope this answered your question
I am using the .Touched
event for the hitbox, but it doesn’t work. If anything touches it, if I use print(Hit.Name)
it doesn’t print and I have no idea why.
local TweenService = game:GetService("TweenService")
local DebrisService = game:GetService("Debris")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerCommunication = ReplicatedStorage:WaitForChild("ServerCommunication")
local Hitbox = script.Hitbox
local Cooldown = 5
local Debounce = {}
local function RecieveSignal(Player)
if table.find(Debounce, Player.Name) then
print("Player is on a cooldown!")
else
local Character = Player.Character
local NewHitbox = Hitbox:Clone()
NewHitbox.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -4)
NewHitbox.Parent = workspace
DebrisService:AddItem(NewHitbox, 1)
TweenService:Create(
NewHitbox,
TweenInfo.new(1),
{Position = Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, -100).Position}
):Play()
NewHitbox.Touched:Connect(function(Hit)
print(Hit.Name)
end)
table.insert(Debounce, Player.Name)
task.wait(Cooldown)
Debounce[table.find(Debounce, Player.Name)] = nil
end
end
ServerCommunication.OnServerEvent:Connect(RecieveSignal)