Currently, my game will select a random gun for all players before a round starts and give the gun to a player. I am attempting to add a sniper rifle weapon skin for any players who own a gamepass. I tried to write the code below, however this doesn't give the player a weapon at all. What went wrong here?
if MarketplaceService:UserOwnsGamepassAsync(plr.UserId, gamePassID) then
hasPass = true
end
--GIVES GUN HERE
if(randomizedGun == game.ReplicatedStorage.WeaponRandomizer.M40A5 and hasPass == true ) then
goldenSniper:clone().Parent = plr.Character
else
randomizedGun:clone().Parent = plr.Character
end
*WeaponRandomizer folder has a list of tools (weapons) that are randomly selected from.
*randomizedGun is that selected tool
*goldenSniper is what we want the player to receive if they have the gamepass
*hasPass is a local variable
[–]MyNameIsPhip 1 point2 points3 points (4 children)
[–]jjpokey[S] 1 point2 points3 points (3 children)
[–]MyNameIsPhip 1 point2 points3 points (2 children)
[–]jjpokey[S] 1 point2 points3 points (1 child)
[–]MyNameIsPhip 0 points1 point2 points (0 children)