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

How to make a game pass that makes a player twice their size?

Hello fellow developers and friends! I am interested as to how I can correctly make a game pass make a player twice their size in game if they own the game pass. I inserted a script into ServerScriptService. Here is what I wrote:

local MS = game:GetService("MarketplaceService") local ID = 10136218

if MS:UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId, ID) then wait(1) game.Players.LocalPlayer.Character.Humanoid.HeadScale = 2 game.Players.LocalPlayer.Character.Humanoid.BodyWidthScale = 2 game.Players.LocalPlayer.Character.Humanoid.BodyHeightScale = 2 game.Players.LocalPlayer.Character.Humanoid.BodyDepthScale = 2 end

It does not work and the output does not output anything? If anyone could help that would mean a life saver to me! Thanks.

1 comment

0

try to use a code block [if thats what its called] for your scripts

2 answers

✓ Accepted answer

Hey, I saw your script and I found a couple errors in it:

  1. Since the script is Client-sided (LocalScript, I knew because LocalPlayer can't be used in a Server-sided script), you should consider changing it to a Server sided script in order for other players to see it

  2. The other error i noticed in your script was that you did not specify .Value when giving values to let's say game.Players.LocalPlayer.Character.Humanoid.BodyHeightScale, a common mistake.

Here should be a Server sided and functioning version of your code:

local MS = game:GetService("MarketplaceService") local ID = 10136218

function playerAdded(player)
	local function onCharacterAdded(char)
		if MS:UserOwnsGamePassAsync(player, ID) then
			wait(1)
			char.Humanoid.HeadScale.Value = 2
		char.Humanoid.BodyWidthScale.Value = 2 
		char.Humanoid.BodyHeightScale.Value = 2 
		char.Humanoid.BodyDepthScale.Value = 2
		end
	end
	player.CharacterAdded:Connect(onCharacterAdded)
end

game.Players.PlayerAdded:Connect(playerAdded)

If it does not work, then please tell me the output, hope this helps!

6 comments

0

Alright I shall try this out and put a regular script into ServerScriptService.

0

Thank you for trying, the script seems to not be working and is outputting this: 14:43:46.165 - Unable to cast Instance to int64

0

Oh, I found out the problem, on line 5 replace player in if MS:UserOwnsGamePassAsync(player, ID) with player.UserId, because UserOwnsGamePassAsync needs the id and not name of actual player, sorry.

0

Let me try that now, thanks.

0

It worked thank you for your time and effort!

0

No problem!

Well I could tell you to use this link? :) https://www.youtube.com/watch?v=UYlN5N1Ury0 Is this works please accept the question it would help a ton!

1 comment

0

I don't know how your answer helps that much really, he asked why his code didn't work and you just sent him a full tutorial, it's not helpful as you'd think it is.

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