Found a issue when using the modified script. When unequiping the crossbow (to std camera), whilst moving, the player character tilts 7 to 8 degrees on the heels (client side). Looks bad. Anyway, effectively hollowing or emptying (commenting out) this function in the shoulder camera script as follows (~ line 488), stops this:
function ShoulderCamera:applyRootJointFix()
if self.rootJoint then
–local translationScale = self.zoomState and Vector3.new(0.25, 0.25, 0.25) or Vector3.new(0.5, 0.5, 0.5)
–local rotationScale = self.zoomState and 0.15 or 0.2
–local rootRotation = self.rootJoint.Part0.CFrame - self.rootJoint.Part0.CFrame.Position
–local rotation = self.rootJoint.Transform - self.rootJoint.Transform.Position
–local yawRotation = CFrame.Angles(0, self.yaw, 0)
–local leadRotation = rootRotation:toObjectSpace(yawRotation)
–local rotationFix = self.rootRigAttach.CFrame
–if self:isHumanoidControllable() then
– rotationFix = self.rootJoint.Transform:inverse() * leadRotation * rotation:Lerp(CFrame.new(), 1 - rotationScale) + (self.rootJoint.Transform.Position * translationScale)
–end
--self.rootJoint.C0 = CFrame.new(self.rootJoint.C0.Position, self.rootJoint.C0.Position + rotationFix.LookVector.Unit)
end
end
– This function keeps the held weapon from bouncing up and down too much when you move. For me, its okay without it and way better than having the player character become tilted.
Tried for hours to sort this and using a new copy on seeing this thread, The WeaponSystem still must be in the StarterPack directory for my weapons to work right now and that was without any edits.
Players cannot use shift though and I get this in Output…
Used ‘papa_kupcake’s’ modified script (several posts above), for the crosbow. Found this varient to work in the starterpack or as I am using it, dispensed on purchasing in game. Where it then copies many of the modular scripts to replicated storage. As I recall Robox page on its weapon kit/s talks about placing most of the scripts directly into replicated storage. However this did not work for this crossbow script when I tried it, and have not noticed any problems, with it coping itself into position post launch for mulitple players.
Yes, the changes I made are mentioned above, as well as the cause of it being broken. @Thundermaker300 actually provided the main fixes. I simply applied them to Roblox’s updated Weapons System.
This weapons system fixes the following issues outlined in this post:
Shoulder script only applies while the gun is equipped (will force stop it when the gun is unequipped)
Camera will not break upon unequipping the tool.
There are still some bugs with it, including…
If the tool is deleted from the character model, the shoulder camera will be stuck until a different weapon is equipped, and the animation will be stuck until the character is reloaded. To fix this, just call Humanoid:UnequipTools() and wait a frame before deleting it.
If the user unequips the tool (either manually or via :UnequipTools()) while they are scoped in, their walkspeed will remain the scope walking speed (which is slower than the default 16 walking speed). This bug wasn’t discussed in this post, but I discovered it on my own.
I forgot to mention this in the previous post, however I got a few questions about this so I’d like to elaborate briefly.
Friendly fire/team killing
if you are using my modified kit found in my post above this one, it comes with a system of preventing same “teams” from attacking each other. You can set this up by following these steps.
Create a StringValue called “Role” in every player character that you want to be factored into the team checking (no string value = no team, they can kill anyone and be killed by anyone)
Set the value to anything you’d like. If the value matches other players, they cannot attack each other.
For example, if you’d like Red and Blue teams, you can use the above system by creating the “Role” StringValue in every red player and give it the value of “Red”, and same for the blue team, except with the value of “Blue” instead.
If you’d prefer to use native team objects, you’ll have to experiment with this on your own as I do not use teams in my projects.
I’m having some problems with R6 with this modified version that I didn’t had before, It works perfectly fine in R15 but when I set the game to R6 it breaks.
When I was doing my optimizations, it was never really meant for R6 being provided that this kit is from Roblox which was made for R15 (Animations and such) and we’ve only modified it to be working with R15 at the moment and preventing stuck animations, mouse locking and other issues, apologies!
I know this a little late, but have you figured out how to properly track who killed a player using this kit? There doesn’t seem to be any creator tags relating this anywhere in the kit.
Kill tracking is not included in the original kit (at least not when we forked it), and as such is not included in our modified kit. You’ll have to implement this yourself.
Sorry to bump but after you delete line 185, put a LocalScript in the tool and put
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local WeaponsSystem = ReplicatedStorage:WaitForChild(“WeaponsSystem”)
local weaponModule = require(WeaponsSystem:WaitForChild(“WeaponsSystem”))
local camera = workspace.Camera
local player = game:GetService(“Players”).LocalPlayer
You can even add 1st person in the guns using this just set the normalOffset thingy to something really less when the guns equipped I have tried it and if u wanna go in advance then you can use UserInputService to enable/disable 1st person when the user presses a key (actually ur gonna change the offset to trick the user lol). Idk how to enable scrolling the camera tho
Sorry to re-ring this, but friendly-fire isn’t working. I have made a StringValue with name “Role” and its value to “player”. The Script is inside StarterPlayer > StarterCharacterScripts
Here is the script:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local role = Instance.new("StringValue", character)
role.Name = "Role"
role.Value = "player"
end)
end)