Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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)
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. AshsmithTube 15 — 3y
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) AshsmithTube 15 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

Answer this question