Hello!
So I decided to make gun givers rather than placing the guns straight into StarterPack
.
But the problem is that it won’t damage players anymore and only NPCs!
I tried searching on this forum but didn’t find anything!
Here’s the script:
script.Parent.ClickDetector.MouseClick:Connect(function(player)
game.ReplicatedStorage.K45:Clone().Parent = player.StarterGear
game.ReplicatedStorage.K45:Clone().Parent = player.Backpack
end)
Thanks and have a nice day!
1 Like
7yoz
(7yoz)
#2
Any Errors?
1 Like
No. There are no errors. I use a LocalScript
from a topic on how to remove the third-person shiftlock. (WeaponsSystem Folder is in the gun)
Link to post: Endorsed Weapons kit camera fix
1 Like
Abcreator
(Abcreator)
#4
If all the players are on the same team, the gun won’t harm other players.
1 Like
7yoz
(7yoz)
#5
LocalScripts will not work
1 Like
The item giver script is a Script
. And the camera fix script is a LocalScript
as suggested in the tutorial.
1 Like
Abcreator
(Abcreator)
#7
But the fact is, if it harms the NPC it is most likely not a problem with the script type.
1 Like
7yoz
(7yoz)
#8
Oh alright, have you made sure that the “third person shiftlock” thing isn’t the one breaking it?
1 Like
Here’s the script if you wonder: (I can’t find the LUA format button)
local WeaponsSystem = script.Parent.WeaponsSystem:WaitForChild("WeaponsSystem")
local weaponModule = require(WeaponsSystem:WaitForChild("WeaponsSystem"))
local camera = workspace.Camera
local player = game:GetService("Players").LocalPlayer
script.Parent.Equipped:Connect(function()
weaponModule.camera:setEnabled(true)
weaponModule.camera.rotateCharacterWithCamera = true
end)
script.Parent.Unequipped:Connect(function()
weaponModule.camera:setEnabled(false)
weaponModule.camera.rotateCharacterWithCamera = false
camera.CameraSubject = player.Character
weaponModule.normalOffset = Vector3.new(0,0,0)
end)
1 Like
Abcreator
(Abcreator)
#10
Are all players on the same team?
1 Like
7yoz
(7yoz)
#11
Yeah… Maybe take a look at the script you are trying to require
1 Like
Actually the game is a FFA (Free For All) but in the future it will include team deathmatch mode.
1 Like
Abcreator
(Abcreator)
#13
However, if TeamsService is enabled and all players are not assigned a team, they will be given the ‘Neutral’ team.
1 Like
7yoz
(7yoz)
#14
Most scripts look for player teams through game.Teams
1 Like
I have Teams
in workspace. Does that mean TeamsService is enabled?
EDIT: I have no team
1 Like
7yoz
(7yoz)
#16
Uhhh what???
1 Like
Abcreator
(Abcreator)
#17
Actually, they do player.TeamColor in endorced scripts.
1 Like
7yoz
(7yoz)
#18
Can’t speak for all of them.
1 Like
Abcreator
(Abcreator)
#19
However, I can speak for the endorced guns as I have read their scripts.
1 Like
7yoz
(7yoz)
#20
Well it’s not a team issue then. Argument, over.
1 Like