im am making a stat gui with in creases the players attack, deffenc, and stamina (which are all int Values in side a Folder named "Stats")
when I click the button , 3 parematers shall be sent to the server which is the...
player's name stat to update the amount to give
but when I print the paramaters on the server side it says this...
Tizzel40
Tizzel40
Attack
here is the local script...
local statsframe = script.Parent
local addAttackb = statsframe.AddAttackButton
local addDefb = statsframe.AddDeffenceButton
local addStaminab = statsframe.StaminaLabel
local addattackrem = game.ReplicatedStorage:WaitForChild("NetworkFolder").AddStats
local play = game.Players.LocalPlayer
local playerstats = play:WaitForChild("Stats")
local amount = 1
local plrname = play.Name
local stattoupdate = "Attack"
addAttackb.MouseButton1Click:Connect(function()
addattackrem:FireServer(plrname,stattoupdate,amount)
end)
and then here is the server script located in serverstorage
local remote = game.ReplicatedStorage:WaitForChild("NetworkFolder").AddStats
remote.OnServerEvent:Connect(function(playername,stattoupdate,amount)
print(playername)
print(stattoupdate)
print(amount)
if game.Players[playername] ~= nil then
print("Verifiction passed #1")
if game.Players:WaitForChild(playername).Stats ~= nil then
print("Verifiction passed #2")
if game.Players:WaitForChild(playername).Stats[stattoupdate].Value > 0 then
print("Verifiction passed #3")
--
game.Players:WaitForChild(playername).Stats:WaitForChild("StatPoints").Value = game.Players:WaitForChild(playername).Stats:WaitForChild("StatPoints").Value - 1
game.Players:WaitForChild(playername).Stats[stattoupdate].Value = game.Players:WaitForChild(playername).Stats[stattoupdate].Value + amount
else
print(playername.."has an Insufficient amount of stat Points and Failed to Increase their "..stattoupdate.."!")
end
end
end
end)
please help me!?

5 comments
Don't include the plrname argument when you fire the event, it includes the player as a parameter automatically.
The Printing Starts happening on lines number 8,9,and 10 on the "Server Sided Script"!
Ooof. You are going to have to explain a bit more clearly. also, please give us the script. It is hard to visualize what you are doing.
huh i did give you the script...?
and Azarth what do you mean about sending the name, i need to send the name!?