Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Resizing a model from client to server?

So I have had a lot of thoughts about this

So Basically

I have a Remote Function which will allow the player to resize things on the client and send it to the server but basically

the only thing I can do here is probably use :GetBoundingBox() or something

but I dont know where to go from there

And the only solution I came up with this was

Send the entire children of the model and use that and create a new model

on the server

to update it

But does anyone know how I would go about resizing a model from client to server?

Any simpler options I am open to

1 answer

Use object oriented programing and just change the CFrame or Vector3

Update:

Sorry for misunderstanding, something like this might work?

Script

local function ResizeModel(Model, Scale)
	local primary = Model.PrimaryPart
	local primaryCf = primary.CFrame

	for _, v in pairs(Model:GetDescendants()) do
		if v:IsA("BasePart") then
			v.Size = v.Size * Scale
			if v ~= primary then
				v.CFrame = primaryCf + primaryCf:inverse() * v.Position * Scale
			end
		end
	end
	return Model
end

ResizeModel(game.Workspace.Model, 5)

11 comments

0

Of course I was going to use Object oriented programming but when resized onto the client how would I know what to size it on the server? do I trust what the client sends and just clone what they sent through the evnet?

0

I dont think you understand my question but a model does not have a size and you cant set a models size the only thing close to that is getboundingbox()

0

I updated my post

0

I got this part right but what I mean is how would I tell the server that I resized it using a remote event when resizing a model

0

The reason this is so hard is because the model has no absolute size that I can rely on so that when the client sends information to the server to resize the server would have to solely rely on what the client has sent

0

The only way I see it is resize the model ---> send the model to the server side or send the information ---> Sanity check ----> :GetBoundingBox() and create a new model out of it

0

I wish models had a size property that we could edit instead of having just :GetBoundingBox() for it

0

We really only have two options going about this

0

Either 1) Send the model from the client to the server whole and completely trust the server on everything and clone that model (Not the best idea)

0
  1. Get the name and size of the children in the model and send it to the server, the server will create a new model entirely using the information and children that the client send ( maybe better)
0

However this is the only thing I could think of unless someone knows any math to do with :GetBoundingBox and knows what to do from there

This discussion is preserved as it was. New answers, comments, and votes are closed.