#I need help with referencing an object.

1 messages · Page 1 of 1 (latest)

plush valley
#

I am making a plates of fate style game and I need to reference something inside the player.
I added the BoolValue into the player using a local script in "StarterPlayerScripts" and in a module script I need to reference that same value to change it when the round starts.
How would I go around doing that.
Also I am new to scripting but learning how to so I don't want people telling me to learn scripting or anything similar because I am and that is not helpful.

strange relic
#

so the bool value is whether the player is playing or not?

eager oasisBOT
#

studio** You are now Level 4! **studio

plush valley
#

yea and set to false when they are in the lobby when they join and when they die

#

the module script broke when i used a player added function

strange relic
#

what error did u get?

#

also module scripts only run or work when they are required from another script so player added would need to be on a different script

plush valley
#

when referencing the module script i go the error saying it gives more than one value about the module script

#

i think its more about not being able to reference the boolvalue from the module script which has all the round systems and plate systems

strange relic
#

could you share the scripts?

plush valley
#

ok

#

local BoolValue = Instance.new("BoolValue")
BoolValue.Name = "isPlaying"
BoolValue.Parent = game:GetService("Players").LocalPlayer
BoolValue.Value = false

#

thats the local script to set the bool value in the player

#

That is the game manage

#

Manager*

#

module script

strange relic
#

you should get rid of the player added thats in the module script and put it in a server script

plush valley
#

I removed the playeradded function but thats what the local script does as we only need the value to add when they join and nothing else

eager oasisBOT
#

studio** You are now Level 2! **studio

strange relic
#

does it work now?

#

or naw?

plush valley
#

it adds the BoolValue but i can't referece the value in the module script to set it as true when the round starts

strange relic
#

probably because it was created in a local script so its not in the server could that be it?

plush valley
#

possibly but it is in Players.MYUSERNAME

strange relic
#

but is it there when you click server?

#

is it there is the server?

plush valley
#

ill test it

strange relic
#

k

plush valley
#

no

strange relic
#

its not there in the server?

plush valley
#

its not so how would i move it

#

no

strange relic
#

ok so you would need to have the boolvalues be given in a server script let me make one

plush valley
#

Ok Thx

strange relic
#

"local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
-- Create "isPlaying" BoolValue on the server
local isPlaying = Instance.new("BoolValue")
isPlaying.Name = "isPlaying"
isPlaying.Value = false
isPlaying.Parent = player
end)
"

#

try that in a server script

#

see if it works

plush valley
#

In ServerScriptService?

strange relic
#

yes

#

let me know if it works now

plush valley
#

ok it has

strange relic
#

it works now?

plush valley
#

Yes

#

Thx

strange relic
#

ofc 😄

#

let me know if you need any other help with this game

plush valley
#

And if i were to use the boolValue to make it so when it is true i could disable a spectate gui so it cant spectate someone when you are in a round and the camera turns back to you

#

let me code the spectateGui first and then ill share it

strange relic
#

k

plush valley
#

also do you have any GUI spectate images such as the binoculars in the style most spectate GUI is made

strange relic
#

i could find some

plush valley
#

ok if you wouldnt mind and also do you know websites that i could find good images for UI

plush valley
#

If thats okay with you

#

@strange relic I don't know if you received these messages or not so i am pinging you to let you know sorry if its a nuisance

strange relic
#

naw its fine

#

what u need?

plush valley
#

ok

#

just a spectate GUI image

#

and maybe a website or somewhere to find other ones

plush valley
#

@strange relic did you find one?

eager oasisBOT
#

studio** You are now Level 3! **studio

strange relic
#

ill look for one

plush valley
#

ok

strange relic
#

but im kinda busy

eager oasisBOT
#

studio** You are now Level 5! **studio

plush valley
#

its okay find one when you can

plush valley
#

@strange relic I need some help with the spectate system

strange relic
#

😭

plush valley
#

what

strange relic
#

im just busy working for someone rn

plush valley
#

ok

#

lmk when you are free to help

plush valley
#

Do you have time to help @strange relic

strange relic
#

no sorry

plush valley
#

Ok

plush valley
#

Do you have time to help @strange relic

#

?