Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make it so whoever is in my group gets a RPG?

game.Players.PlayerAdded:Connect(function(newPlayer)
	if newPlayer:IsInGroup(7) then
		local Launcher = game:GetService("ServerStorage"):WaitForChild("Launcher"):Clone()
		Launcher.Parent = player.Backpack
	end
end)

I made this code to make sure whoever is in the group will get an RPG as a gift in my game. But the 4th line that says = player.Backpack the player in this code has an error... I would like a fix please. I worked hard to make this code... :(

Very appreciated!

2 answers

✓ Accepted answer

Okay, so i have found the fix it has to be a script in ServerScriptService deleted where it says "6351583" and put ur group id there.

game.Players.PlayerAdded:Connect(function(newPlayer)
if newPlayer:IsInGroup(6351583) then
local Launcher = game:GetService("ServerStorage"):WaitForChild("Launcher"):Clone()
Launcher.Parent = newPlayer.Backpack
end
end)

2 comments

0

It didn't work I actually wanted it for my RPG, so I did the following the item is in ServerStorage and the script is in ServerScriptService.

0

game.Players.PlayerAdded:Connect(function(newPlayer) if newPlayer:IsInGroup(9594606) then local RPG = game:GetService("ServerStorage"):WaitForChild("RPG"):Clone() RPG.Parent = newPlayer.Backpack end end)

you made the player newPlayer so it has to be newPlayer.Backpack not player.Backpack

This discussion is preserved as it was. New answers, comments, and votes are closed.