Hello, I’m doing a character creation, and it has a Body Size part
However it is in localscript and I’m not getting it as a script that executes a function when a RemoteEvent fires the server
--Starting Script
script.Parent.MouseButton1Click:Connect(function()
local Humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale
local HS = Humanoid.HeadScale
HS.Value = 0.8499999999999999778
BDS.Value = 1
BWS.Value = 1
BHS.Value = 1
end)
In the script, instead of working for a specific number, I want it to be any number. I tried to do this but it didn’t work : /
I’m a bit confused as to what you mean exactly. But from what I understand, the server script won’t execute that code you showed in the post (the server script you failed to do)?
It’s likely because the server can’t access “humanoid”, as it is in LocalPlayer, which is only accessible from the client-side, not the server.
And, where are you firing the Remote Event? Could you share the code for the LocalScript that fires the Remote Event to the server?
And also, I’m a bit confused as to what you’re doing here. You receive “humanoid” in the parameters (with no capital letters), but then you change the values for “Humanoid” (which has a capital H). Is that a typo?
When connecting a remote event on the server the first argument is the player, then is what you sent in the remote, so you do no need to send the humanoid argument, also, ensure you find some way of validating this remote event.
event.OnServerEvent:Connect(function(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
end)