I am trying to make a script where something random happens. On the first part the game has a chance of making the baseplate ice and slippery but for the second part im trying to make it so the character increases in size but it does not seem to work. This is my script:
local baseplate = workspace.Baseplate
local originalProps = baseplate.CustomPhysicalProperties
local RandomNumber = math.random (2,2)
if RandomNumber == 1 then
print("1")
game.Workspace.Baseplate.Material = "Ice"
baseplate.CustomPhysicalProperties = PhysicalProperties.new(
originalProps.Density,
0, -- Friction,
originalProps.Elasticity,
100, -- Friction weight
originalProps.ElasticityWeight)
game.Workspace.Baseplate.CustomPhysicalProperties.FrictionWeight = 100
end
if RandomNumber == 2 then
print ("2")
local Character = game.Players
local Humanoid = Character.PlayerAdded:FindFirstChild("Humanoid")
for i,Child in pairs (Humanoid:GetChildren()) do
if Child.Name == 'BodyDepthScale' then
Child.Value = 1
elseif Child.Name == 'HeadScale' then
Child.Value = 1
elseif Child.Name == 'BodyHeightScale' then
Child.Value = 1
elseif Child.Name == 'BodyWidthScale' then
Child.Value = 1
end
end
end
