I've created a project which is based mostly upon projectiles - at first, I had the server handle literally everything, and that caused all the projectiles and jazz to lag, so I've decided to have all the parts managed clientside.
In this scenario, I've created a RemoteEvent.OnClientEvent function, which is called by a client firing a RemoteEvent to fire this ClientEvent. The visual part is fine, and the projectile lag I had before is completely gone, but now the bullets do no damage at all? I've no clue why, as the script IS in the part, all values ARE returning, but it just doesn't want to do damage.
I've guessed that it was because the parts don't actually exist on the server, but how can I overcome this problem and make these parts do OnTouch Damage?
Here's a faint idea of the code i've been using;
-- Inside the Client Event (In a localscript in StarterGui) local ball = Instance.new("Part") ball.Name = "BlastBullet" Resources.MarkInfo(set, "BlastBullets", dmg, script.BlastBulletDamage, ball) -- The Server Event bb.OnServerEvent:Connect(function(player,set, dmg) local spell = game.ReplicatedStorage:WaitForChild("BlastBullets") spell:FireAllClients(player,set, dmg) end) -- The LocalScript which fires the server event local ev = game.ReplicatedStorage:WaitForChild("BlastIsFat") ev:FireServer(Settings, Resources.CalculateDamage1(Settings))
I'll start explaining from topdown, as it makes sense.
The client event is basically creating a part called BlastBullet, i've left out the details of shaping the parts because nobody wants to see that. What 'Resources.MarkInfo' does is take the Settings table, which was passed through from the other localscript, and basically just clones the damage script(a server script), add's values such as 'Creator', 'Damage', and all of that jazz, and enables it.
The server event is literally the only way I could think of to pass the information.
The localscript, which is the script containing all mana checks, damage calculations, animations, etc, fires that server event, and passes all the information in that script to the server, which, using FireAllClients(), replicates everything to every client.
Basically, the parts don't exist on the server and I don't know how to make those parts actually to OnTouch damage.
I also don't want to use RayCasting, because, well, they're projectiles. If any more information is needed, let me know! My discord is evil#7042, but i'll still be spam refreshing this page.