I want to get the size of the part by these if statements.
When It’s at size fourth or it’s supposed to be at fourth and it is supposed to print size then
it prints nil.
if mouse.Target.Parent ~= workspace and mouse.Target.Parent:FindFirstChild("Log") then
local size
local log = mouse.Target.Parent.Log
if log.Size.X > 1.25 and log.Size.Y > 10 and log.Size.Z > 1.25 then
size = "Full"
elseif log.Size == Vector3.new(5, 2, 2) then
size = "Half"
elseif log.Size == Vector3.new(5, 2, 1) then
size = "Fourth"
end
print(size)
script.Parent.Log:FireServer(log, size)
end
Add prints in every check and add a final else with a print at the end; see which prints, also try printing the log’s size, some debugging might help us
I suggest not using a global variable as a local variable. It will usually return nil and may break your script or overwrite what it does. However I am not positive about what the consequences are.
If it changes color, then don’t save it as a variable. Replace log with Log or log1. Just a heads up.