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

Huge math question?

How could I make it so someone has like for example: Darkness 2 has it so you buy a gamepass for 10x Beast chance... how could I do something like that?

1 answer

You mean like checking if a user has an item? That is fairly easy. To do so, you must use > game:GetService('BadgeService').

Thanks to ROBLOX's addition of BadgeService, you don't have to wear an item to have something work. Here's a script example to make a player's health 50 if they have roblox's "April Fool" hat (by doing that, I show you that you can use ANY item ID (assets are now the same as item id, no -1) as a pass.)

game.Players.PlayerAdded:connect(function (player) --When a player joins the game....
	if game:GetService("BadgeService"):UserHasBadge(player.userId, 151784428) then--Get if the player has the hat by getting their user ID (which has inventory stuff) and the hat ID.
		player.Character.Humanoid.Health = 50
	else
		player.Character.Humanoid.Health = 100 --Not needed, but I can put it there
	end
end)

1 comment

0

No, im actually trying to get it so, players have a higher chance of becoming (beast) or more percentage of becoming it.

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