ivydoIl
(BeamedByAlex)
August 31, 2021, 9:05pm
#1
Hello! I’ve been trying to script a daycare game, but it has been really difficult because I can’t make non-group members small (as a toddler). But if they’re a certain rank in the group, they’ll be normal size. I tried looking up tutorials about character scaling, but it never works. If you could help me, I apricate it!
Example:
https://www.roblox.com/games/345387015/PETS-Little-Angels-Daycare
https://www.roblox.com/games/1046870993/Little-Dreamies-Daycare
2 Likes
lelion77
(lelion77)
August 31, 2021, 9:08pm
#2
Sorry I’m a bit confused.
Is the issue that you don’t know how to scale the player, or that you don’t know how to check if the player is a certain rank?
EDIT:
I now understand. Here’s how you do it:
local Humanoid = ReplaceThisWithHowYouAreGettingTheHumanoid()
local HS = Humanoid.HeadScale
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale
HS.Value = HS.Value * ReplaceWithYourCustomScale
BDS.Value = BDS.Value * ReplaceWithYourCustomScale
BWS.Value = BWS.Value * ReplaceWithYourCustomScale
BHS.Value = BHS.Value * ReplaceWithYourCustomScale
This question (of sizing) has been asked many times. Please search it up
local HS = Humanoid.HeadScale
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale
HS.Value = HS.Value * 2
BDS.Value = BDS.Value * 2
BWS.Value = BWS.Value * 2
BHS.Value = BHS.Value * 2
You can change the scale of the player with the Scale properties in the Humanoid. The default scale size is 1. Remember that Roblox allows players to slightly modify their body proportions in Avatar selection, so if you plan to revert the player you will ne…
Before setting the size use an If statement to check if plrbodyscale < limit then. If it is less than the max limit then it will increase the size, if it isn’t you can return “limit”
https://developer.roblox.com/en-us/api-reference/function/Player/GetRankInGroup
So for checking a players group rank can I make it to were it checks if its a group of ranks, for example if players are in Rank ID 2 and Rank ID 5 how would i write it out in a script, ik you can only check for ranks higher and lower but never in a range of ranks.
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(groupId) == 1 then
-- do something here
end
end)
and you can also do this
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(groupId) >…
Here are a bunch of links I’ve gathered on both problems.
ivydoIl
(BeamedByAlex)
August 31, 2021, 9:18pm
#6
local shrink_val = 0.5
local player = game.Players.LocalPlayer
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(4594985) == 200 then
player.Character.Humanoid.HeadScale.Value = shrink_val
player.Character.Humanoid.BodyDepthScale.Value = shrink_val
player.Character.Humanoid.BodyWidthScale.Value = shrink_val
player.Character.Humanoid.BodyHeightScale.Value = shrink_val
player.Character.Humanoid.WalkSpeed = 50
player.Character.Humanoid.JumpPower = 100
game.Workspace.CurrentCamera.FieldOfView = 25
end
end)
I tried, but didn’t work
Maybe try on a normal script? Somewhere I have a script for this. Give me a second to find it. . . .
Almost found it. . . .
Try this? Pretty sure this is what I did:
local HS = Humanoid.HeadScale
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale
HS.Value = HS.Value * 2
BDS.Value = BDS.Value * 2
BWS.Value = BWS.Value * 2
BHS.Value = BHS.Value * 2
Which script is the error from?
ivydoIl
(BeamedByAlex)
August 31, 2021, 9:32pm
#11
There is only 1 script, the character scale
lelion77
(lelion77)
August 31, 2021, 9:37pm
#12
Are you doing this from a localscript? If so it won’t work.
This line of code:
local Humanoid = game.Players.LocalPlayer.player.Character()
is only possible in a localscript.
lelion77
(lelion77)
August 31, 2021, 9:44pm
#14
Then you cannot get the LocalPlayer.
Replace all that code with this:
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(4594985) == 200 then
local Humanoid = Player.Character.Humanoid
local HS = Humanoid.HeadScale
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale
HS.Value = HS.Value * 2
BDS.Value = BDS.Value * 2
BWS.Value = BWS.Value * 2
BHS.Value = BHS.Value * 2
end
end)
lelion77
(lelion77)
August 31, 2021, 9:56pm
#16
You probably deleted a bracket.
Also, I realized a bit after I posted that it wouldn’t work.
This new code should work:
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character.Humanoid
local HS = Humanoid.HeadScale
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale
HS.Value = HS.Value * 2
BDS.Value = BDS.Value * 2
BWS.Value = BWS.Value * 2
BHS.Value = BHS.Value * 2
end)
end)
2 Likes