It sounds like you have some rewriting to do. Your current system sounds like a mess and difficult to maintain.
It might help if you shared the scripts that gives the tools in the first place, as a starter to where we can set you back on the right path.
the script that gives you them on death or the one that gives them in general?
The one that gives the purchased weapons in the first place.
its not the purchased weapons i am having problems with its the ones in starter pack the other one is admin exclusive and only given to me using a script
Why are the admin exclusive weapons in the StarterPack
? They should be placed in the ServerStorage
service instead, and given to an admin from there.
they are but they have the same problem as starter pack weapons
Put the admin tools in a Folder
titled AdminTools
in the ServerStorage
service and try this code out.
local adminTools = game:service("ServerStorage"):WaitForChild("AdminTools")
local admins = {"Diam0ndzOnYT"}
game:service("Players").PlayerAdded:Connect(function(player)
if admins[player.Name] == nil then return end
player:WaitForChild("StarterGear")
for _, tool in ipairs(admintools:children()) do
tool:Clone().Parent = player.StarterGear
end
player:LoadCharacter()
end
alr as for the starter pack though?
If another script’s giving those tools, remove them from the StarterPack
. Otherwise, leave them as-is.
il try it know il replay when i finish my testing
it doesnt even give me the banhammer anymore when i spawn in
Is the Script
the one I gave earlier? If so, that should be in the ServerScriptService
, not in with the admin tool folder. Script
s are suspended in the ServerStorage
and ReplicatedStorage
.
no the one you gave me is in serverscript service and dont think i put it in wrong
local adminTools = game:service(“ServerStorage”):WaitForChild(“AdminTools”)
local admins = {“Diam0ndzOnYT”}
game:service(“Players”).PlayerAdded:Connect(function(player)
if admins[player.Name] == nil then return end
player:WaitForChild(“StarterGear”)
for _, tool in ipairs(admintools:children()) do
tool:Clone().Parent = player.StarterGear
end
player:LoadCharacter()
end
I see the problem. I made the admins
table an array instead of a dictionary. Replace the line below
local admins = {"Diam0ndzOnYT"}
with this
local admins = { ["Diam0ndzOnYT"] = true }
ok im changing it now hope it works!
would this require something like hd admin to work?
No, it would not require an admin commands program for this to work.