#i really dont know why is my currency system not working yet.

92 messages · Page 1 of 1 (latest)

ionic briar
#

its for a simulator game im making just to test my skills.

half nexus
#

what do you mean by "not working"?

#

@ionic briar ⬆️

ionic briar
#

When you play the game the stud count needs to apear in the leader stats

#

@half nexus

half nexus
#

on line 11 add

print(Player:GetPlayers())
#

and then tell me what it returns

#

@ionic briar

ionic briar
#

Ight

#

@half nexus

half nexus
#

that's weird, I expected it to have a different output

#

huh

ionic briar
#

bugs make me super mad sometimes

half nexus
#

perhaps we try adding in
print(player)
inside the function to see

  1. if it gets called
    and 2. if it has the player
ionic briar
#

alr lemme see

ionic briar
half nexus
#

first line of the function

ionic briar
eager goblet
ionic briar
#

lemme try

half nexus
#

it should, yet you should still do that as it is faster then doing it in 1 line

#

yes luau is amazing, the one which takes more lines to write is the faster of the 2

ionic briar
#

fr

eager goblet
#

Parenting of Instance.new

#

is weird

eager goblet
#

just manual parent it using property

#

isntead argument

#

create new line

#

and yes

#

line 8

ionic briar
#

ight

half nexus
#

you mean 4 and 7 I hope

eager goblet
#

do it also for leaderstats, cuz eh, God knows

eager goblet
#

he will add space

half nexus
ionic briar
#

alr

half nexus
#

(maybe it would be a good idea to send a screenshot of the current script so we get the lines right)

ionic briar
#

ok

eager goblet
#

how

#

so fail

#

I never seen so much fail

ionic briar
#

same

eager goblet
#

just

#

send the code

#

here

#

I go fork feed it

ionic briar
#

ok

#

local Player = game:GetService("Players")

local function setupPlayerData(player: player)
local leaderstats.Parent = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"

local studs.Parent = Instance.new("IntValue", player)
studs.Name = "Studs"
studs.Value = 0

end
print(Player:GetPlayers())
Player.PlayerAdded:Connect(setupPlayerData)

eager goblet
#

thanks for not formatting it in a language box

ionic briar
#

omg sorry

ionic briar
eager goblet
#

OH

#

OH

#

MAN

#

U BLIND

#

xd

#

I also

#

u parent the studs

#

to player

#

not

#

leaderstats

ionic briar
#

oooh

meager kernelBOT
#

studio** You are now Level 11! **studio

eager goblet
#

see both arguments

#

go on player

#

instead of first player

#

then leaderstats

half nexus
#

@ionic briar

local Players = game:GetService("Players")

local function setupPlayerData(plr :Player)
    local LS = Instance.new("Folder")
    LS.Parent = plr
    LS.Name = "leaderstats"
    
    local S = Instance.new("IntValue")
    S.Parent = LS
    S.Name = "Studs"
    S.Value = 0
end

Players.PlayerAdded:Connect(setupPlayerData)
#

retyped your script and fixed it

eager goblet
#

thats not problem

#

it was his

ionic briar
#

ight

eager goblet
#

argument

#

use

#

issue

#

but u can use that one too

half nexus
#

you can change the variables, I just got lazy while typing to function 😆

eager goblet
#
local Players = game:GetService("Players")

local function setupPlayerData(player: player)
    local leaderstats = Instance.new("Folder", player)
    leaderstats.Name = "leaderstats"

    local studs = Instance.new("IntValue", leaderstats)
    studs.Name = "Studs"
    studs.Value = 0
end

Players.PlayerAdded:Connect(setupPlayerData)
ionic briar
#

omg ty guys

eager goblet
#

of course it work

#

im 0xFF

ionic briar
#

lol

half nexus
#

mine worked first

#

the one and only Herman

#

who isn't fully sober

ionic briar
#

and im the one and only noob scripter python