|
| 03 Oct 2013 10:27 PM |
Most of this stuff in the middle doesn't matter but the script just doesn't even do anything though, it theoretically should. The stats should be in the Player but nope, nothing happens.
function CreateStats(Player) wait(1) Stats = Instance.new("Configuration") Stats.Name = "Stats" Stats.Parent = Player CharacterStats = Instance.new("Configurtion") CharacterStats.Parent = Stats Level = Instance.new("NumberValue") Level.Parent = CharacterStats Level.Name = "Level" Level.Value = 1 Experience = Instance.new("NumberValue") Experience.Parent = CharacterStats Experience.Name = "Experience" Experience.Value = 0 Gold = Instance.new("NumberValue") Gold.Parent = CharacterStats Gold.Name = "Gold" Gold.Value = 0 MaxHealth = Instance.new("NumberValue") MaxHealth.Parent = CharacterStats MaxHealth.Name = "MaxHealth" MaxHealth.Value = 100 MaxStamina = Instance.new("NumberValue") MaxStamina.Parent = CharacterStats MaxStamina.Name = "MaxStamina" MaxStamina.Value = 100 MaxMana = Instance.new("NumberValue") MaxMana.Parent = CharacterStats MaxMana.Name = "MaxMana" MaxMana.Value = 100 CurrentHealth = Instance.new("NumberValue") CurrentHealth.Parent = CharacterStats CurrentHealth.Name = "CurrentHealth" CurrentHealth.Value = 100 CurrentStamina = Instance.new("NumberValue") CurrentStamina.Parent = CharacterStats CurrentStamina.Name = "CurrentStamina" CurrentStamina.Value = 100 CurrentMana = Instance.new("NumberValue") CurrentMana.Parent = CharacterStats CurrentMana.Name = "CurrentMana" CurrentMana.Value = 100 HealthMod = Instance.new("NumberValue") HealthMod.Parent = CharacterStats HealthMod.Name = "HealthMod" HealthMod.Value = 0 StaminaMod = Instance.new("NumberValue") StaminaMod.Parent = CharacterStats StaminaMod.Name = "StaminaMod" StaminaMod.Value = 0 ManaMod = Instance.new("NumberValue") ManaMod.Parent = CharacterStats ManaMod.Name = "ManaMod" ManaMod.Value = 0 SpeedMod = Instance.new("NumberValue") SpeedMod.Parent = CharacterStats SpeedMod.Name = "SpeedMod" SpeedMod.Value = 0 TempHealthMod = Instance.new("NumberValue") TempHealthMod.Parent = CharacterStats TempHealthMod.Name = "TempHealthMod" TempHealthMod.Value = 0 TempStaminaMod = Instance.new("NumberValue") TempStaminaMod.Parent = CharacterStats TempStaminaMod.Name = "TempStaminaMod" TempStaminaMod.Value = 0 TempManaMod = Instance.new("NumberValue") TempManaMod.Parent = CharacterStats TempManaMod.Name = "TempManaMod" TempManaMod.Value = 0 TempSpeedMod = Instance.new("NumberValue") TempSpeedMod.Parent = CharacterStats TempSpeedMod.Name = "TempSpeedMod" TempSpeedMod.Value = 0 GlobalStats = Instance.new("Configurtion") GlobalStats.Parent = Stats UserStats = Instance.new("Configurtion") UserStats.Parent = Stats end
game.Players.ChildAdded:connect(CreateStats)
|
|
|
| Report Abuse |
|
|
|
| 03 Oct 2013 10:29 PM |
| Where are you testing this script? Play Solo? |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Oct 2013 10:34 PM |
| CreateStats(Player) is a Roblox function? |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Oct 2013 10:37 PM |
| Your character is loading before the script, so if you test this in a simulated server, it should work. |
|
|
| Report Abuse |
|
|
|
| 03 Oct 2013 10:37 PM |
oh here, its the same deal with tycoons: PlayerAdded doesn't work as you want it to in play solo
instead it being the playeradded event, just start it out as an argument waiting for Player1
heres an example I use with tycoons: feel free to edit how you want
local test = game.Players:FindFirstChild("Player1") if test ~= nil then wait(.5) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local stats2 = Instance.new("IntValue") stats2.Name = "Tycoon"
local cash = Instance.new("IntValue") cash.Name = "Cash" cash.Value = 100 -- This is how much money each player gets when they start the game. You can change it if you want to.
cash.Parent = stats stats2.Parent = test stats.Parent = test end |
|
|
| Report Abuse |
|
|
|
| 03 Oct 2013 10:39 PM |
| Don't add what random says, it doesn't matter what happens in Play Solo, as long as it works in the real game. |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 03 Oct 2013 10:43 PM |
| Remember -- always test the final script in Online Mode! |
|
|
| Report Abuse |
|
|
|
| 03 Oct 2013 10:49 PM |
Instance.new("Configuration")?
theres your first problem |
|
|
| Report Abuse |
|
|
|
| 03 Oct 2013 10:53 PM |
| random, please learn more about scripting before you make suggestions on the Scripting Forum. This script should, in theory, create all stats. |
|
|
| Report Abuse |
|
|
|
| 03 Oct 2013 11:00 PM |
I meant the typo "Configurtion"
oops
and to make any stat script to run in play solo(for testing purposes, only works in solo) remove the function Whateverfunctionyoucallit(newPlayer)
replace it with
local test = game.Players:FindFirstChild("Player1") if test ~= nil then
and remove the function call |
|
|
| Report Abuse |
|
|