#When I kill somone with my sniper it does not load up in kill leaderboard.

1 messages · Page 1 of 1 (latest)

sullen cipher
#

I have tried everything but every time i change the script or add smth the gun dont work longer. I'm using the sniper bundle from roblox.

topaz violet
#

Script? Video?

sullen cipher
#

ServerWeaponsScript

#

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")

local curWeaponsSystemFolder = script.Parent
local weaponsSystemFolder = ReplicatedStorage:FindFirstChild("WeaponsSystem")
local weaponsSystemInitialized = false

local function initializeWeaponsSystemAssets()
if not weaponsSystemInitialized then
-- Enable/make visible all necessary assets
local effectsFolder = weaponsSystemFolder.Assets.Effects
local partNonZeroTransparencyValues = {
["BulletHole"] = 1, ["Explosion"] = 1, ["Pellet"] = 1, ["Scorch"] = 1,
["Bullet"] = 1, ["Plasma"] = 1, ["Railgun"] = 1,
}
local decalNonZeroTransparencyValues = { ["ScorchMark"] = 0.25 }
local particleEmittersToDisable = { ["Smoke"] = true }
local imageLabelNonZeroTransparencyValues = { ["Impact"] = 0.25 }
for _, descendant in pairs(effectsFolder:GetDescendants()) do
if descendant:IsA("BasePart") then
if partNonZeroTransparencyValues[descendant.Name] ~= nil then
descendant.Transparency = partNonZeroTransparencyValues[descendant.Name]
else
descendant.Transparency = 0
end
elseif descendant:IsA("Decal") then
descendant.Transparency = 0
if decalNonZeroTransparencyValues[descendant.Name] ~= nil then
descendant.Transparency = decalNonZeroTransparencyValues[descendant.Name]
else
descendant.Transparency = 0
end
elseif descendant:IsA("ParticleEmitter") then
descendant.Enabled = true
if particleEmittersToDisable[descendant.Name] ~= nil then
descendant.Enabled = false
else
descendant.Enabled = true
end
elseif descendant:IsA("ImageLabel") then
if imageLabelNonZeroTransparencyValues[descendant.Name] ~= nil then
descendant.ImageTransparency = imageLabelNonZeroTransparencyValues[descendant.Name]
else
descendant.ImageTransparency = 0
end
end
end

    weaponsSystemInitialized = true
end

end

#

ClientWeaponsScript:

#

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local playerChildAddedConnection
local replicatedStorageChildAddedConnection
local clientWeaponsScript
local weaponsSystemFolder

local function setupWeaponsSystem()
local WeaponsSystem = require(weaponsSystemFolder.WeaponsSystem)
if not WeaponsSystem.doingSetup and not WeaponsSystem.didSetup then
WeaponsSystem.setup()
end
end

local function onReplicatedStorageChildAdded(child)
if child.Name == "WeaponsSystem" then
setupWeaponsSystem()
replicatedStorageChildAddedConnection:Disconnect()
end
end

local function onPlayerChildAdded(child)
if child.Name == "PlayerScripts" then
clientWeaponsScript.Parent = child
playerChildAddedConnection:Disconnect()
end
end

if script.Parent.Name ~= "PlayerScripts" then
clientWeaponsScript = script:Clone()
local PlayerScripts = script.Parent.Parent:FindFirstChild("PlayerScripts")

if PlayerScripts ~= nil then
    clientWeaponsScript.Parent = PlayerScripts
else
    playerChildAddedConnection = script.Parent.Parent.ChildAdded:Connect(onPlayerChildAdded)
end

else
weaponsSystemFolder = ReplicatedStorage:FindFirstChild("WeaponsSystem")
if weaponsSystemFolder ~= nil then
setupWeaponsSystem()
else
replicatedStorageChildAddedConnection = ReplicatedStorage.ChildAdded:Connect(onReplicatedStorageChildAdded)
end
end

#

NetworkingCallbacks

#

local WeaponsSystem = NetworkingCallbacks.WeaponsSystem
if not WeaponsSystem then
return
end

local weapon = WeaponsSystem.getWeaponForInstance(instance)
local weaponType = getmetatable(weapon)

if weapon and weaponType then
    if weapon.instance == instance and weapon.player == player then
        weapon:setActivated(activated, true)
    end
end

end

return NetworkingCallbacks

#

WeaponsSystem

topaz violet
sullen cipher
#

?