Needing Help on how to make a developers only item, thanks!

Hello,

I’m trying to make a jetpack in a game i’m trying to make but I only want it so only developers can use the jetpack in game. I’m not really sure on how to do this but would like some on advice on how to make a only developer item.

Thanks, SkY_Yale.

2 Likes

If you want to restrict an item to be used only by a developer, scripting it requires checking the ID first before usage. If the ID in a valid list, the player will have the jetpack functionality enabled.

5 Likes

It’s not really complicated. Just make a table with the developer(s) userId and when a player enters, loop through the arrays and if met, replicate the jetpack to their backpack.

3 Likes

Thanks, but how do I make this table?

2 Likes

hmm, how would I do this I’m just confused sorry.

2 Likes

In your case for user ids, it would be;

local devids = {1,2} -- user ids
1 Like

You can make a table with all your developers User ID’s in, and then check for the player in a server script game.Players.PlayerAdded:Connect(function(player) and if the player User ID matches the table (which you can check for by using table.find) then clone the jetpack from ReplicatedStorage, and put it in there Backpack.

It would be something like this, (I haven’t tested this code yet)

local YourTable = {UserID,UserID,etc}
local jetpack = game.replicatedstorage.jetpack:Clone()
game.Players.PlayerAdded:Connect(function(player)
       if table.find(YourTable, player.UserId) then
          jetpack.Parent = player.Backpack
       else
         -- do nothing
       end
end)
1 Like

Is there a tutorial perhaps? if not I’ll just look for videos one by one following your guide, thanks a lot by the way!

What’s not clear about my code? (I need feedback) :slight_smile: (I’ll test the code later, and let you know)

It’s just that I’m not an experienced scripter, I mainly use blender so this stuff it new to me. Sorry about that.

Don’t worry man, I’m a noob scripter, this is beginner level stuff :slight_smile: :sweat_smile: :+1:
Maybe watch some YouTube tutorials?

1 Like
local Developers = {09124124,12441242, "NameOfPlayer"} -- Creating a table, etiher enter their Name or UserId, Most people use UserId since players names can be changed.
local Players = game:GetService("Players") -- Similar to game.Players, better to build a habbit of using :GetService()

Players.PlayerAdded:Connect(function(player) -- Basic stuff you should learn, PlayerAdded Event
   if table.find(Developers, player.UserId) then -- If you used names then keep it as player
       local Jetpack -- Wherever your jetpack is :Clone() it 
       jetpack.Parent = player.Backpack -- Just parenting the Jetpack to the players Backpack.
   end
end)

-- I would highly recommend learning tables, and just the basics first. Hope this helps!
2 Likes

Thanks, but where would I put this script?

This script would go in ServerScriptService.

Thank you very much, this is very helpful!