Hello! I’m making a slider that changes the player’s size (custom character) But it doesnt seem to work. The slider is working and everything but its just the size wont change. Here is my local script in a text button.
local P = game.Players.LocalPlayer
script.Parent.Changed:Connect(function()
local S = script.Parent.Position.X.Scale
local N = math.floor(S*100)
local V = N
local H = P.Character:FindFirstChild("Humanoid")
if H then
H.HeadScale.Value = 1 + (1*V)
H.BodyDepthScale.Value = 1 + (1*V)
H.BodyWidthScale.Value = 1 + (1*V)
H.BodyHeightScale.Value = 0.9 + (1*V)
end
end)
Any help would be appreciated!
Not sure if character scaling works on client. Try converting this code to server and see what happens!
1 Like
Ok, I’ll try that right now. I’ll let you know how it goes.
Wait, how exactly will I do that? The server cant see the PlayerGui right?
Nope server can see Player Gui. I just dont recommend it. U can use it from server though. I do sometimes
Oh ok then. I’ll try it out then.
Ok now the values arent changing at all. I used to same script in a local script and the values change.
This code wont work if you copied the exact same code to the server. If you are changing the UI size on the client the server wont pick that up. Use a remote event to send information to the server and then perform the math on the server and set the character scale. A little bit like this.
--Server
RemoteEvent.OnServerEvent:Connect(function(P,S)
local N = math.floor(S*100)
local V = N
local H = P.Character:FindFirstChild("Humanoid")
if H then
H.HeadScale.Value = 1 + (1*V)
H.BodyDepthScale.Value = 1 + (1*V)
H.BodyWidthScale.Value = 1 + (1*V)
H.BodyHeightScale.Value = 0.9 + (1*V)
end
end)
--Client
S.Changed:Connect(function()
RemoteEvent:FireServer(script.Parent.Position.X.Scale)
end)
Oh ok, Thank you! Ill try this.
Thank you so much! It worked! I just had to adjust it a bit.
Glad to be able to help! Good luck with the game!