So I want to change a players value without using remote events or ontouched, any help? Here is the script.
local Players = game:GetService("Players") local Player = Players.LocalPlayer local character = Player.Character or Player.CharacterAdded:Wait() game.Workspace.CustomizationPartGui.SurfaceGui.FirstName.Alex.MouseButton1Click:connect (function () Player:WaitForChild("leaderstats").FirstName.Value = game.Workspace.CustomizationPartGui.SurfaceGui.FirstName.Alex.Text end)
You would have to separate the script with a localscript. You could have a localscript that is disabled as a child of the server script. The localscript will have a string value inside it. The localscript would change the value of the surface gui to the value of the string value.
The server script would clone the disabled localscript, change the stringvalue of the cloned instance, and place in the player you want to change. Then enable the localscript.
But in my opinion, it's much much easier to do this via localscript and not server.