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

I need help! T-shirt being able to modify humanoid stats!?

Asked by 7 years ago

I wanted to make a script where if you buy a certain t-shirt the script would be able to change that person's speed & health. I'm not sure if this is correct but..

game.Players.PlayerAdded:connect(function(plr) if game:GetService("MarketplaceService")PlayerOwnsAsset(plr,assetId) then plr.CharacterAdded:connect(function(char) humanoid = char:WaitForChild("Humanoid") humanoid.WalkSpeed = amount humanoid.MaxHealth = amount humanoid.Health = amount end) end end)

Even if i did try this where would i put the t-shirt id?

1 answer

Log in to vote
2
Answered by 7 years ago

The t-shirt ID would go at the 'assetId' bit in the code below.

if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,assetId) then
0
Thank you so much! seathewickedemperor 4 — 7y
0
Could you accept the answer? LittleBigDeveloper 245 — 7y
0
One more thing. Where do i put this script in studio & What script would it be? I'm new to this. seathewickedemperor 4 — 7y
0
You would put it in a server sided place. Like workspace or serverscriptservice LittleBigDeveloper 245 — 7y
Ad

Answer this question