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

how do i fix these scripts for strength value to be doubled the value?

local id = 9121302

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
	if purchased and id == ido then
		plr.Character.Humanoid.Strength.Value = 2
	end
end)

game.Players.PlayerAdded:Connect(function(plr)
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,id)then
		game.Workspace:WaitForChild(plr.Name):WaitForChild("Humanoid").Strength.Value = 2
	end
end)

5 comments

0

what's the error? also, can you format it in code block?

0

well, you first need a strength system. do you have a value that represents strength or something? there is no built in strength feature in roblox, you have to script it yourself.

0

i have put one

0

is it in a value somewhere?

0

its in NumberValue

2 answers

the error is i want to make a 2X strength gamepass but i was using a 2X Speed gamepass script can you help me fix it to make it work? Vid_eo

It looks like you are setting the value directly to 2, instead of multiplying by 2

Try doing

plr.Character.Humanoid.Strength.Value = plr.Character.Humanoid.Strength.Value *  2

--and

local strenght = game.Workspace:WaitForChild(plr.Name):WaitForChild("Humanoid").Strength.Value
strenght  =  strenght  * 2

2 comments

0

it does not work can you give like the full script plus the script you gave combined?

0

I do not know the intricacies of your game to be able to do that.

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