why can’t I upload the animation
Hi, thanks for the tutorial, it’s been incredibly useful. I have no past experience with making frameworks and it would take me ages to figure all this out.
Based on your code and diagram I made some sort of client-server security, but I don’t think i understood it correctly and I’m not sure whether the thing I came up with has holes in it:
- As the client shoots, a local bullet on his side is fired instantly and along with it a server-sided fire event gets triggered.
- The client’s shot has pure cosmetic purpose and only generates a visual effect upon hit.
- The triggered server fire function validates whether this shot is possible by the client.
- Server fires it’s own plain invisible shot without generating any effects. The server’s shot deals damage upon hitting a player.
- Along with firing the server shot, the server notifies all the other clients to generate their own cosmetic version of the shot.
In the fps script you have the canFire, firing, reloading and ammo variables. Should the server keep track of this data as well to determine a shot’s validity?
I don’t understand what the bullet IDs are intended to be used for.
The server can keep it’s own track of ammo data based on fire and reload requests from the client.
In the diagram you have indicated client to server communication when the bullet reaches it’s destination. What is it for? Isn’t the server’s hit detection enough?
What I used the bullet IDs for is generating reproducible and hopefully by exploiters not editable bullet spread angle, as described in this post.
I’ll be grateful for any advice.
In the fps script you have the canFire, firing, reloading and ammo variables. Should the server keep track of this data as well to determine a shot’s validity?
your choice, ammo should stay synced between the 2 sides though
I don’t understand what the bullet IDs are intended to be used for.
IDs are intended to keep track of the bullet’s original stats to compare them against where the client/server hits the shot after casting it, stated below in my quoted message
The server can keep it’s own track of ammo data based on fire and reload requests from the client.
In the diagram you have indicated client to server communication when the bullet reaches it’s destination. What is it for? Isn’t the server’s hit detection enough?
it’s not. clients are often desynced between what the server and individual players see so for good hitreg you need to let the client deal damage sometimes, hence the communication
edit: looking at your understanding, the “only generates a visual effect upon hit” seems to be the only incorrect thing, the original person firing also sends a request to damage a humanoid if it hits one (passed through server verification as stated in the diagram and above)
Thank you, that is the explanation I needed.
A useful thing for you or for others may be, that the up-to-date version of FastCastRedux has a UserData table attached to each cast, which can be the alternative to keeping a table of bullet data indexed with IDs.
I use this in my current bullet module
What’s still not clear to me is, how can the server possibly validate the hit, if the server is desynced and the client claims to have hit someone. An exploiter could just fire random shots dealing damage to certain humanoids and “convince” the server it’s desynced.
A solution I thought of is, to count the amount of times the client had to be trusted like this and if it happens too often, the client would be marked as sus.
Also would you check for client’s hit detection even on the replicated shots?
What’s still not clear to me is, how can the server possibly validate the hit, if the server is desynced and the client claims to have hit someone. An exploiter could just fire random shots dealing damage to certain humanoids and “convince” the server it’s desynced.
“desync” in point-blank range is often not bad enough for a hit to not be verifiable via the sanity checks, there is no “convincing” other than straight up teleport exploits
A solution I thought of is, to count the amount of times the client had to be trusted like this and if it happens too often, the client would be marked as sus.
amogus
send help
mr doge man
You don’t have a variable named “players” created.
Can you reply with the link of the “Weld Editor” Plugin you were using here?
For some reason, the event always says that the bullet is nil
Code:
function rayUpdated(_, segmentOrigin, segmentDirection, length, velocity, bullet)
local BulletLength = bullet.Size.Z / 2 -- This is used to move the bullet to the right spot based on a CFrame offset
bullet.CFrame = CFrame.new(segmentOrigin, segmentOrigin + segmentDirection) * CFrame.new(0, 0, -(length - BulletLength))
end
(this also happens with the ray hit function)
Has anybody tried making crouch/laying and sprinting for this framework? I’m trying to make my own system for that but i always end up giving up.
Either
- grab and modify an existing foot planting script (it doesn’t have to be inside the framework at all, as long as you have a Crouching/Prone variable to modify)
- modify the character’s RootJoint C0/C1 to look like they’re crouching
- play animations for each stance
I have not tried the last one, but the base thing is adding a :crouch() function to the framework and doing whatever in there
The first option sounds the easiest, thank you BlackShibe! I didn’t think of using something outside the framework so i just overcomplicated everything.
How would I go about making the arms look the same as my characters arms? I understand that I could just change the Arm’s BrickColor but how would I go about making the shirt visible there too? instead of just a being naked arm.
like make the blue sleeve show up
You have to either make a custom hand with UV mapping that matches the shirt texture or insert a humanoid where the arms are with a shirt instance
Thank you so much for this! It was so helpful, it even made me make this:
https://web.roblox.com/games/6671117691/FPS-Test
check ur animations. that might’ve been messed up
Hello!
This tutorial was really useful! I learned a lot and I’m even going to make my own FPS
game, but I have one question, you said that we shouldn’t use the “Hit” remote event on a real game, so, what are the other ways of detecting the ray hit? or is there a more efficient way of doing it?