Script
local theeventis = script.Parent.Main local thevalueis = script.Parent.TheValueOfIt.Value local function servergotfired(player, pname) game.Players[pname].leaderstats.Cash.Value = thevalueis end theeventis.OnServerEvent:Connect(servergotfired)
LocalScript
script.Parent.pressme.MouseButton1Down:Connect(function() local pname = script.Parent.pname local pvalue = script.Parent.pvalue local theeventis1 = script.Parent.Parent.Main local Player = game.Players script.Parent.Parent.TheValueOfIt.Value = pvalue.Text theeventis1:FireServer(pname.Text) end)
So basically my problem here is to get the value that I want to put in the following name using script not local script, The real problem is the script can't get the value of TheValueOfIt. Someone Help Me Please!
You're trying to set the value of an object on the client and then retrieve that value on the server. This doesn't work because it's FilteringEnabled and the changes you made via the LocalScript don't replicate to the server.
What you want to do instead is to pass TheValueOfIt through the RemoteEvent, along with pname.Text
, and then you can get it in your Script, along with pname
.