Body Size Changer

Hello Developers!
So I been trying to do something like a height changer script for R6. Well just changing the size of the Body parts. But I want it to fire all the clients that it changed. And I am not really good at FiringClients or telling a script to fire all the clients.

The script:

--// Main Varibles
local Character = script.Parent.Parent.Parent
local Changed = game:GetService("ReplicatedStorage").Functions.Character:WaitForChild("HeightChanged")
local Ui = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Height").Frame.TextButton

--// Body Parts
local Humanoid = Character:WaitForChild("Humanoid")
local Torso = Character:WaitForChild("Torso")
local LeftArm = Character:WaitForChild("Left Arm")
local LeftLeg = Character:WaitForChild("Left Leg")
local RightArm = Character:WaitForChild("Right Arm")
local RightLeg = Character:WaitForChild("Right Leg")

--// Change Body Size
Ui.MouseButton1Click:Connect(function()
	Torso.Size = Vector3.new(1, 1, 1)
end)
1 Like

So I’m not going to assume anything, just that you have a remotefunction/event.

Try redirecting your script to a remotefunction, have a serverscript redirect it, and then fire all the clients, sooo.

Ui.MouseButton1Click:Connect(function()
	Torso.Size = Vector3.new(1, 1, 1)
    MyRemoteEvent:FireServer()
end)

ServerScript now


MyRemoteEvent.OnServerEvent:Connect(function(plr)
   MyRemoteEvent:FireAllClients()
end)

Then in your local script, have

MyRemoteEvent.OnClientEvent:Connect(function()
   --Do stuff
end)

I’d recommend having your local script send something to your remote event to make it so that the change is visible on the whole server, instead of keeping it in the localscript, but up to you.

Okay so I understand what your saying but at the same time im not. Cause its difficult for me. Cause its my first time working with Events

You could take a look at this & break the model’s script down perhaps?

Let me give you a rough explanation.

RemoteEvents are a way of sending information of triggering things by sending things to the server, and to the client. The client is your screen, the server is everyone’s screen. LocalScripts only replicate/work in the client and only you see what happens with LocalScripts. Regular Scripts work for the server. I won’t go too in depth, but if you want to read the basic functions/events of RemoteEvents I recommend going to the roblox page for it.