--------------------------
--Script(ServerScriptService)
local money = game:GetService("ServerStorage"):WaitForChild("PlayerMoney")
local event = game:GetService("ReplicatedStorage").Events.CashGui
event.OnServerEvent:Connect(function(PlayerText, Cash)
money[PlayerText.Text].Value = money[PlayerText.Text].Value + Cash.Text
end)
--------------------------
-- LocalScript(gui)
local plr = game:GetService("Players").LocalPlayer
local event = game:GetService("ReplicatedStorage").Events.CashGui
local money = game:GetService("ServerStorage"):WaitForChild("PlayerMoney")
local Send = script.Parent.GiveCash
function Smart()
local PlayerText = script.Parent.PlayerText
local Cash = script.Parent.CashText
local plr = game:GetService("Players"):FindFirstChild(PlayerText.Text)
if plr then
event:FireServer(PlayerText, Cash)
else
print(PlayerText.Text.. " is Offline.")
end
end
Send.MouseButton1Click:Connect(Smart)
Error:
--Text is not a valid member of Player
-- Script 'ServerScriptService.CashGUi', Line 6

6 comments
Weird, should've worked :/
Did you change anything?
How strange, I had already tried it and it made a mistake and now it worked.
Other than the line I told you
Oh brilliant, have a nice day then :)
I went for a look at LocalScript and it was FireServer (plr, Cash) dizzy