zafariki
|
  |
| Joined: 12 Oct 2010 |
| Total Posts: 42 |
|
|
| 12 Dec 2015 05:41 PM |
So i have scripted this using allot of wiki reading and help from other users.. BUT!.. It doesn't work :c This script load the value's wich the gui can work with ( that part works ) But I the problem is I can't get the value's for the gui there in online mode. i've tried allot , it's might be a stupid mistake or something idk but i'm out of idea's of possible problems. game link: http://www.roblox.com/games/232617477
------------- [Code] ---------------------------------------------------------
local DataStore = game:GetService("DataStoreService"):GetDataStore("Store") print('worked') game.Players.PlayerAdded:connect(function(p) --p:WaitForDataReady() print('worked') local data = DataStore:GetAsync("user_"..p.userId) print('worked')
local PlayerData = Instance.new("Folder") PlayerData.Name = "PlayerData" PlayerData.Parent = p
local Weapon = Instance.new("StringValue") Weapon.Name = "Weapon" Weapon.Parent = PlayerData Weapon.Value = "Famas F1"
local Stats = Instance.new("Folder") Stats.Name = "Stats" Stats.Parent = PlayerData
local Kills = Instance.new("NumberValue") Kills.Name = "Kills" Kills.Parent = Stats Kills.Value = 0
local Deaths = Instance.new("NumberValue") Deaths.Name = "Deaths" Deaths.Parent = Stats Deaths.Value = 0
local XP = Instance.new("NumberValue") XP.Name = "XP" XP.Parent = Stats XP.Value = 0
local Settings = Instance.new("Folder") Settings.Name = "Settings" Settings.Parent = PlayerData
local Volume = Instance.new("NumberValue") Volume.Name = "Volume" Volume.Parent = Settings Volume.Value = 100
local Quality = Instance.new("NumberValue") Quality.Name = "Quality" Quality.Parent = Settings Quality.Value = 0.5
local AccentColor = Instance.new("Color3Value") AccentColor.Name = "AccentColor" AccentColor.Parent = Settings AccentColor.Value = Color3.new(0.882353, 0.666667, 0)
local Sounds = Instance.new("Folder") Sounds.Name = "Sounds" Sounds.Parent = PlayerData
local tic_sound = Instance.new("Sound") tic_sound.Name = "tic_sound" tic_sound.Parent = Sounds tic_sound.SoundId = "rbxassetid://177266782"
local select_sound = Instance.new("Sound") select_sound.Name = "select_sound" select_sound.Parent = Sounds select_sound.SoundId = "rbxassetid://146730311" ---------------------------------------------------- if data then print('worked') Kills.Value = data["Kills"] print('worked') Deaths.Value = data["Deaths"] print('worked') XP.Value = data["XP"] print('worked') Weapon.Value = data["Weapon"] print('worked') AccentColor.Value = Color3.new(unpack(data["AccentColor"])) -- unpack of the RGB table print('worked') end end)
game.Players.PlayerRemoving:connect(function(p) local DataToSave = {Kills=p.PlayerData.Stats.Kills.Value,Deaths=p.PlayerData.Stats.Deaths.Value,XP=p.PlayerData.Stats.XP.Value,Weapon=p.PlayerData.Stats.Weapon.Value,AccentColor = {p.PlayerData.Settings.AccentColor.Value}} -- I did this table to load the RGB color of this Color3 value, they will be unpacked later DataStore:SetAsync("user_"..p.userId, DataToSave) end)
game.OnClose = function() wait(3) end |
|
|
| Report Abuse |
|
|
zafariki
|
  |
| Joined: 12 Oct 2010 |
| Total Posts: 42 |
|
|
| 12 Dec 2015 05:41 PM |
| game link : http://www.roblox.com/games/232617477/Test-Gui |
|
|
| Report Abuse |
|
|
zafariki
|
  |
| Joined: 12 Oct 2010 |
| Total Posts: 42 |
|
| |
|
zafariki
|
  |
| Joined: 12 Oct 2010 |
| Total Posts: 42 |
|
| |
|
zafariki
|
  |
| Joined: 12 Oct 2010 |
| Total Posts: 42 |
|
| |
|