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)
Might wanna check that any of the function is running.
When I encounter an error with no output, I shove print statements everywhere, to check whats running.
Or, I have totaly missed something, in that case, sorry.
I solved the issue, turns out the part had to be anchored for .Touched
to function as intended.
Interesting, I never knew that…
Nice find.
I don’t remember that being needed? Are you sure canTouch is enabled on your hit box?
Yes, it was enabled. I know anchoring it worked because when I enabled it, it worked.
Hi guys, part 2 is in the works - just letting you guys know!
Can you show us both the scripts at the end of each parts. Like “This is what these scripts should look like at the end” That would be extremely helpful!
I’m just here since I do not know ANYTHING about client replication and I immediately went to scripting, I have 2 questions
- how would I send BodyVelocity information? im currently dealing with this type of velocity. https://gyazo.com/ccdafc03e7c655c58731629787909788.mp4
- Since the values in the video above are randomized and are actively changing, what could I do?
may I see your source code? It would make it easier to solve the problem