Ok I have two files, one is a client menu that saves a bunch of variables, I have to move these variables from client side to server side and run a function that saves them… It’s not working though because apparently it doesn’t know the ply… (player)
cl_begin.lua
[lua]if (points < 1) or (NameText:GetValue() == “”) then
local NameFixBefore = NameText:GetValue()
local NameFixAfter = string.gsub(NameFixBefore, “,”, " ") – THis makes sure there are no comma’s in the name as that will be what we parse by.
Name = NameFixAfter
PlayerAttackLevel = AttackLevel:GetValue() – Make attack nothing
PlayerDefenseLevel = DefenseLevel:GetValue() – Make defense nothing
PlayerCraftingLevel = CraftingLevel:GetValue() – Make crafting nothing
PlayerThieveryLevel = ThieveryLevel:GetValue() – Make thieving nothing
PlayerStaminaLevel = StaminaLevel:GetValue() – Make stamina nothing
PlayerSpeedLevel = SpeedLevel:GetValue() – Make speed nothing
NewPanel:Close()
else
ButtonFinished:SetText( “Unused Points or No Name” )
end[/lua]
init.lua
[lua]function CharacterSave( ply )
if !file.IsDir(“Dusted”) then // If the data file doesn’t have a save path yet.
file.CreateDir(“Dusted”)
end
if !file.IsDir(“Dusted/Saves”) then // If no save directory in the data path
file.CreateDir(“Dusted/Saves”)
end
file.Write(“Dusted/Saves/”…ply:UniqueID()…".txt", Name…","…PlayerAttackLevel…","…PlayerDefenseLevel…","…PlayerCraftingLevel…","…PlayerThieveryLevel…","…PlayerStaminaLevel…","…PlayerSpeedLevel)
end[/lua]