Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How can I make the changes of a local script global without RemoteEvents?

Asked by
Jo_Bot 67
6 years ago

I made this huge local script for my custom character, and it makes the character able to be customized. When I test it, it only appears for 1 player, since FE is enabled. What could I do besides using Remote Events to make it visible for everyone? (No, I'm not going to disable FE)


wait(1) local plr = script.Parent.Parent local mouse = plr:GetMouse() local chr = plr.Character local skin = plr.PlayerGui.Customize.Frame.SkinTone local play = plr.PlayerGui.Customize.Frame.Play local gender = plr.PlayerGui.Customize.Frame.Gender local hair = plr.PlayerGui.Customize.Frame.Hair local frame = plr.PlayerGui.Customize.Frame local editing = play.Editing editing.Parent = chr editing.Value = true --skintone skin.Lightest.MouseButton1Click:connect(function() --stuff(cant go above character limit) end) skin.Light.MouseButton1Click:connect(function() --stuff(cant go above character limit) end) skin.Middle.MouseButton1Click:connect(function() --stuff(cant go above character limit) end) skin.Dark.MouseButton1Click:connect(function() --stuff(cant go above character limit) end) skin.Darkest.MouseButton1Click:connect(function() --stuff(cant go above character limit) end) --gender Gender = "Male" gender.Female.MouseButton1Click:connect(function() chr.Head.Hair.Mesh.MeshId = chr.Head.Hair.Two.Value chr.LowerTorso.Pants.Mesh.MeshId = chr.LowerTorso.Pants.Two.Value chr.UpperTorso.Shirt.Mesh.MeshId = chr.UpperTorso.Shirt.Two.Value chr.LeftUpperArm.LeftSleeve.Mesh.MeshId = chr.LeftUpperArm.LeftSleeve.Two.Value chr.RightUpperArm.RightSleeve.Mesh.MeshId = chr.RightUpperArm.RightSleeve.Two.Value chr.LeftUpperLeg.LeftPants.Mesh.MeshId = chr.LeftUpperLeg.LeftPants.Two.Value chr.RightUpperLeg.RightPants.Mesh.MeshId = chr.RightUpperLeg.RightPants.Two.Value chr.Head.Mesh.MeshId = chr.Head.Two.Value chr.Head.Mesh.MeshId = chr.Head.Two.Value chr.LowerTorso.Mesh.MeshId = chr.LowerTorso.Two.Value chr.UpperTorso.Mesh.MeshId = chr.UpperTorso.Two.Value chr.LeftUpperArm.Mesh.MeshId = chr.LeftUpperArm.Two.Value chr.RightUpperArm.Mesh.MeshId = chr.RightUpperArm.Two.Value chr.LeftUpperLeg.Mesh.MeshId = chr.LeftUpperLeg.Two.Value chr.RightUpperLeg.Mesh.MeshId = chr.RightUpperLeg.Two.Value chr.LeftLowerArm.Mesh.MeshId = chr.LeftLowerArm.Two.Value chr.RightLowerArm.Mesh.MeshId = chr.RightLowerArm.Two.Value chr.LeftLowerLeg.Mesh.MeshId = chr.LeftLowerLeg.Two.Value chr.RightLowerLeg.Mesh.MeshId = chr.RightLowerLeg.Two.Value chr.LeftHand.Mesh.MeshId = chr.LeftHand.Two.Value chr.RightHand.Mesh.MeshId = chr.RightHand.Two.Value chr.LeftHand.Mesh.MeshId = chr.LeftHand.Two.Value chr.RightHand.Mesh.MeshId = chr.RightHand.Two.Value chr.Head.Hair.Mesh.Offset = Vector3.new(0,0,0.1) chr.LeftUpperArm.Mesh.Scale = Vector3.new(.75, 0.75, .75) chr.RightUpperArm.Mesh.Scale = Vector3.new(.75, 0.75, .75) chr.LeftUpperArm.Mesh.Offset = Vector3.new(0, -.1, 0.1) chr.RightUpperArm.Mesh.Offset = Vector3.new(0, -.1, 0.1) chr.LeftUpperArm.LeftElbowRigAttachment.Position = Vector3.new(-0.113, -0.336, 0.173) chr.RightUpperArm.RightElbowRigAttachment.Position = Vector3.new(0.113, -0.336, 0.173) chr.LeftLowerArm.LeftElbowRigAttachment.Position = Vector3.new(0.18, 0.288, 0.041) chr.RightLowerArm.RightElbowRigAttachment.Position = Vector3.new(-0.18, 0.288, 0.041) Gender = "Female" end) gender.Male.MouseButton1Click:connect(function() chr.Head.Hair.Mesh.MeshId = chr.Head.Hair.One.Value chr.LowerTorso.Pants.Mesh.MeshId = chr.LowerTorso.Pants.One.Value chr.UpperTorso.Shirt.Mesh.MeshId = chr.UpperTorso.Shirt.One.Value chr.LeftUpperArm.LeftSleeve.Mesh.MeshId = chr.LeftUpperArm.LeftSleeve.One.Value chr.RightUpperArm.RightSleeve.Mesh.MeshId = chr.RightUpperArm.RightSleeve.One.Value chr.LeftUpperLeg.LeftPants.Mesh.MeshId = chr.LeftUpperLeg.LeftPants.One.Value chr.RightUpperLeg.RightPants.Mesh.MeshId = chr.RightUpperLeg.RightPants.One.Value chr.Head.Mesh.MeshId = chr.Head.One.Value chr.LowerTorso.Mesh.MeshId = chr.LowerTorso.One.Value chr.UpperTorso.Mesh.MeshId = chr.UpperTorso.One.Value chr.LeftUpperArm.Mesh.MeshId = chr.LeftUpperArm.One.Value chr.RightUpperArm.Mesh.MeshId = chr.RightUpperArm.One.Value chr.LeftUpperLeg.Mesh.MeshId = chr.LeftUpperLeg.One.Value chr.RightUpperLeg.Mesh.MeshId = chr.RightUpperLeg.One.Value chr.LeftLowerArm.Mesh.MeshId = chr.LeftLowerArm.One.Value chr.RightLowerArm.Mesh.MeshId = chr.RightLowerArm.One.Value chr.LeftLowerLeg.Mesh.MeshId = chr.LeftLowerLeg.One.Value chr.RightLowerLeg.Mesh.MeshId = chr.RightLowerLeg.One.Value chr.LeftHand.Mesh.MeshId = chr.LeftHand.One.Value chr.RightHand.Mesh.MeshId = chr.RightHand.One.Value chr.LeftHand.Mesh.MeshId = chr.LeftHand.One.Value chr.RightHand.Mesh.MeshId = chr.RightHand.One.Value chr.Head.Hair.Mesh.Offset = Vector3.new(0,0.3,0.05) chr.LeftUpperArm.Mesh.Scale = Vector3.new(1, 0.75, 1) chr.RightUpperArm.Mesh.Scale = Vector3.new(1, 0.75, 1) chr.LeftUpperArm.Mesh.Offset = Vector3.new(0, 0, 0) chr.RightUpperArm.Mesh.Offset = Vector3.new(0, 0, 0) chr.LeftUpperArm.LeftElbowRigAttachment.Position = Vector3.new(-0.215, -0.507, 0.209) chr.RightUpperArm.RightElbowRigAttachment.Position = Vector3.new(0.215, -0.507, 0.209) chr.LeftLowerArm.LeftElbowRigAttachment.Position = Vector3.new(0.088, 0.351, 0.105) chr.RightLowerArm.RightElbowRigAttachment.Position = Vector3.new(-0.088, 0.351, 0.1051) Gender = "Male" end) --hair hair.Brown.MouseButton1Click:connect(function() chr.Head.Hair.Color = hair.Brown.BackgroundColor3 end) hair.Blonde.MouseButton1Click:connect(function() chr.Head.Hair.Color = hair.Blonde.BackgroundColor3 end) hair.Orange.MouseButton1Click:connect(function() chr.Head.Hair.Color = hair.Orange.BackgroundColor3 end) hair.Black.MouseButton1Click:connect(function() chr.Head.Hair.Color = hair.Black.BackgroundColor3 end) local Hair = true hair.Check.MouseButton1Click:connect(function() wait(.01) if Hair == true then print("HairGone") hair.Check.ImageLabel.ImageTransparency = 1 chr.Head.Hair.Transparency = 1 wait(.01) Hair = false end end) hair.Check.MouseButton1Click:connect(function() wait(.01) if Hair == false then print("HairBack") hair.Check.ImageLabel.ImageTransparency = 0 chr.Head.Hair.Transparency = 0 wait(.01) Hair = true end end) play.MouseButton1Click:connect(function() editing.Value = false play.Parent.Parent.Enabled = false wait() end) wait()

3 answers

Log in to vote
7
Answered by 6 years ago

You need to do that on the server to replicate changes to other clients. There is not a hacky workaround to using a remote event; you just need to use a remote event. Have the client fire to the server requesting the customization choices desired; then apply all property changes on the server.

0
okay, so have each option (Skin tone, Gender, Hair on/off, and Hair color) a parameter of the Remote Event sent from the local script, then have the server script use those parameters to change the player? (And the first parameter is the player, of course) Jo_Bot 67 — 6y
0
Yes; the listener on the server will always be passed the player responsible for the client event as the first parameter. You would fire with a parameter for each property change, looking somewhat like this: RemoteEvent:FireServer(skinColor, hairModelName, hairColor) assuming those variables are the correct values as assigned by gui selections. Because the player is passed as the first parameter t InfinityDesign 280 — 6y
Ad
Log in to vote
3
Answered by 6 years ago

You have two choices, use remotes or disable FE. Just serverscripts alone (referring to first answer) won't work, due to this modifying a specific player/being on the player GUI.

0
You're incorrect there. You need to handle property assignment on the server to replicate changes to all clients. Any changes made on the client will not replicate to other clients and disabling FE should not even be an option you consider. InfinityDesign 280 — 6y
Log in to vote
0
Answered by 6 years ago

remote events

Answer this question