Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local players = game:GetService("Players")
- local function UpdatePlayerSize(player)
- local leaderstats = player:WaitForChild("leaderstats")
- local strength = leaderstats:WaitForChild("Strength")
- local storage = player:WaitForChild("Storage")
- local scale = ((strength.Value/storage.Value)*100)
- if strength.Value == 0 then
- scale = 1
- player.CameraMaxZoomDistance = 128
- player.CameraMinZoomDistance = 0.5
- workspace.SellPart.Attachment.SellPrompt.MaxActivationDistance = scale*10
- else
- workspace.SellPart.Attachment.SellPrompt.MaxActivationDistance = scale*10
- player.CameraMaxZoomDistance = scale*10
- player.CameraMinZoomDistance = scale*2
- end
- local character = player.Character
- if not character then return end
- local h = character:WaitForChild("Humanoid")
- h.BodyDepthScale.Value = scale
- h.BodyHeightScale.Value = scale
- h.BodyWidthScale.Value = scale
- h.HeadScale.Value = scale
- end
- local function onPlayerAdded(player)
- local stats = Instance.new("Folder")
- stats.Name = "leaderstats"
- stats.Parent = player
- player.CharacterAdded:Connect(function()
- UpdatePlayerSize(player)
- end)
- local cash = Instance.new("IntValue")
- cash.Name = "Cash"
- cash.Value = 0
- cash.Parent = stats
- local storage = Instance.new("IntValue")
- storage.Name = "Storage"
- storage.Value = 5
- storage.Parent = player
- local strength = Instance.new("IntValue")
- strength.Name = "Strength"
- strength.Value = 0
- strength.Parent = stats
- strength:GetPropertyChangedSignal("Value"):Connect(function()
- UpdatePlayerSize(player)
- end)
- end
- players.PlayerAdded:Connect(onPlayerAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement