Help with Code for a Tool

So what i am trying to do is have the script to check the players scale and if its less then 1.5 then it drops the tool i thought this

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Tool = script.Parent

local function onEquipped()
    local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
    local currentScale = character:GetScale()

    if currentScale < 1.5 then
        Tool:Deactivate()
    end
end

Tool.Equipped:Connect(onEquipped)

would work but it doesnt any ideas on what i should fix?

I’ve never heard of :GetScale(), but I think the way I’d go about this is by checking the size of one of the limbs (Such as the torso) and checking if it’s below a certain threshold like you were already doing.

what do you mean by less than 1.5?
1.5 studs or what?

Because when you use GetScale on a rig/NPC it takes it from the original size of it.

Rig1 is the size of a normal player
Rig2 is half the size of a normal player
Rig3 is 2/10 the size of a normal player

So this:

local rig1 = game.Workspace.Rig1
local rig2 = game.Workspace.Rig2
local rig3 = game.Workspace.Rig3

print(rig1:GetScale())
print(rig2:GetScale())
print(rig3:GetScale())

Would print out
1,
0.5,
0.2

just to clear up any confusion

the players scale is set to 1.5 so when you use getscale you get get 1.5

i will try that and see if it works

Im not too sure how to get a players limb size

i realized that you cant force a player to drop a tool as far as i know so i just used “destroy”

local LocalPlayer = Players.LocalPlayer
local Tool = script.Parent
while true do
local function onEquipped()
    local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
    local currentScale = character:GetScale()

    if currentScale < 1.5 then
		Tool:Destroy()
    end
end
wait(0.1)
Tool.Equipped:Connect(onEquipped)
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.