I am trying to load in gun engines, without the grouplocked script it works perfectly, but I wish to make them group locked and it seems like every time I do I press the button and it still just does the coding with taking into consideration the actual grouplocked part itself, with this it also reloads the gun engine thats already loaded instead of loading the unloaded one.
i would recommend you to move the tools too server storage since serverscriptservice is not made to store models/parts but only to work with scripts, and can you provide more informations of how you want it to work, like with a UI or something else
it works fine, server storage is bugging out cus roblox is broke, so for now i just need it to be group locked and if i am in the group it continues to run the script and if i am not in the group it doesnt run it
so in what you told , you are telling to the script gives the tool to “owner only” since rank “255” is the group owner rank and no one else, and give that person the tool
well it doesnt matter, the coding works fine without the group lock, i dont need to mess with the coding for the gun engines, i just need the group lock to work
well it doesnt matter, the coding works fine without the group lock, i dont need to mess with the coding for the gun engines, i just need the group lock to work, is there anywhere to do that?
just to ask are you using a GUI to give the player the tools?
if no then use this in serverscriptservice as a serverscript
-- CE Variables
local CEServer = game.ServerScriptService.Carbon_SEngine
local CEGui = game.StarterGui.Carbon_CEngine
-- ACS Variables
local ACSServer = game.ServerScriptService.ACS_Server
local ACSClient = game.StarterPlayer.StarterCharacterScripts.Saude.ACS_Client
local CETool = game.ServerScriptService["CEAR-15"]:Clone()
local CETool1 = game.ServerScriptService["CEAR-15"]:Clone()
local ACSTool = game.ServerScriptService["AR-15"]
local minRank = 255
local groupId = 16968869
local function giveTool(player)
CEServer.Enabled = true
CEGui.Enabled = true
ACSServer.Enabled = false
ACSClient.Enabled = false
CETool.Parent = game.Teams["Team 1"]
CETool1.Parent = game.Teams["Team 2"]
ACSTool:Destroy()
-- Give the tool to the player
local tool = CETool:Clone()
tool.Parent = player.Backpack
end
game.Players.PlayerAdded:Connect(function(player)
if player:GetRankInGroup(groupId) >= minRank then
giveTool(player)
end
end)
-- Give the tool to existing players when the script runs
for _, player in ipairs(game.Players:GetPlayers()) do
if player:GetRankInGroup(groupId) >= minRank then
giveTool(player)
end
end
Why don’t you just make a team for the groups, put all group members in 1 team and all non in the other, and then give the gun as a startertool of team?