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.
#I need help with referencing an object.
1 messages · Page 1 of 1 (latest)
so the bool value is whether the player is playing or not?
** You are now Level 4! **
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
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
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
could you share the scripts?
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
you should get rid of the player added thats in the module script and put it in a server script
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
** You are now Level 2! **
it adds the BoolValue but i can't referece the value in the module script to set it as true when the round starts
probably because it was created in a local script so its not in the server could that be it?
possibly but it is in Players.MYUSERNAME
ill test it
k
no
its not there in the server?
ok so you would need to have the boolvalues be given in a server script let me make one
Ok Thx
"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
In ServerScriptService?
ok it has
it works now?
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
k
also do you have any GUI spectate images such as the binoculars in the style most spectate GUI is made
i could find some
ok if you wouldnt mind and also do you know websites that i could find good images for UI
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 did you find one?
** You are now Level 3! **
ill look for one
ok
but im kinda busy
** You are now Level 5! **
its okay find one when you can
@strange relic I need some help with the spectate system
😭
what
im just busy working for someone rn
Do you have time to help @strange relic
no sorry
Ok