#I need help with booleans

139 messages · Page 1 of 1 (latest)

little beacon
#

So i did this script and it doesnt work for some reason it gives value 3 even if there requirments arent right

#

Here is what it does

#

idk why

burnt gulch
#

mkae sure u used good server side or client side

little beacon
#

I dod

#

Did

#

It all works great but for some reason

#

When I first go in it

#

It's alr

#

But then

#

When I go second time

#

It bugs and the value given is 2

#

For some reason

#

If u wanna help look at the vid so yk what I am saying

burnt gulch
#

suggest u make a table for players and just add player or remove that should be maybe better

#

like

local playerlist = {}

part.touched:Connect(function(hit)
  if hit.parent:GetPlayerFromCharacter() then
    local plr = game.Players:GetPlayerFromCharacter(hit.Parent) 
    table.insert(playerlist,plr)
  end
end)
#

and for numbers of players in lobby u can do #playerlist

eternal charm
#

why is it good

#

are there evil server side scripts

burnt gulch
#

i mean is he used server side and local side in good way

eternal charm
#

yeah using something in a good way is probably what you want

grave arch
eternal charm
#

guess i gotta watch out for those then

grave arch
#

yup

#

be careful

eternal charm
#

its game.Players:GetPlayerFromCharacter(hit.Parent)

burnt gulch
#

i forgot

#

mb

eternal charm
#

ur good

#

lemme just fix this cuz theres some minor mistakes thatll break the script
like

local playerList = {}

part.Touched:Connect(function(hit) -- .touched wont work, use .Touched
  local player = game.Players:GetPlayerFromCharacter(hit.Parent) 
  if player then -- its less taxing to get player once rather than twice unecessarily
    table.insert(playerList, player)
  end
end)
little beacon
#

Well yea

#

But the problem with table is

#

That I can't like get to the table from other script

#

So I used attributes

eternal charm
#

oh but you can

little beacon
#

Oh

#

Well

eternal charm
#

theres multiple ways to do it

little beacon
#

I didn't know that

#

And is the attributes mistake?

eternal charm
#

wait is the script you wanna get the table from a server script too?

little beacon
#

Btw i tryna make the queue system

little beacon
eternal charm
eternal charm
little beacon
#

Yea maybe

#

But

eternal charm
#

that way you already have the table

little beacon
#

It works

#

The problem is

#

The 2 value sectio

#

Section

#

Idk why

little beacon
eternal charm
#

wait

#

is Value an attribute?

little beacon
#

I need to get to the table from local script

little beacon
#

Boolean

eternal charm
#

but ok i get you

eternal charm
little beacon
#

Amm well

eternal charm
#

you need to do
plr1:GetAttribute("Value")

#

not plr1.Value

little beacon
#

Why when u got boolean there already is a value

#

Am I right?

eternal charm
#

what

little beacon
#

Yea

#

Or??

eternal charm
#

whats your first language

little beacon
#

Slovakia

#

Why?

eternal charm
#

nothing i just wanted to know if it was spanish so i could communicate more clearly

#

okay so

little beacon
#

Oh

eternal charm
#

basically you cant access attributes the same way as properties

little beacon
#

Wanna go in dms?

eternal charm
#

part.Value accesses a property named Value
part:GetAttribute("Value") accesses an attribute named Value

eternal charm
little beacon
#

Ohh

#

So i need the attribute?

eternal charm
#

Value is an attribute right????

little beacon
#

Isnt it property?

eternal charm
#

bro

#

you told me it was an attribute

little beacon
#

Nvm its value

#

I thought i made it attribute

eternal charm
#

what would be the point of making it an attribute

#

ok whatever

#

the point is

little beacon
#

Idk i searched smt up abt attribute

eternal charm
#

your script is a mess and i dont even know what its trying to do

little beacon
#

Lemme explain

#

Soo

#

there is 4 section of IF statement

eternal charm
#

why

#

it doesnt look like you need that

little beacon
#

bc i need to figure out if there is player or not

#

and how many players are there

eternal charm
#

but why if statement

little beacon
#

Well what was i supposed to do

eternal charm
#

loop

little beacon
#

What will loop do

#

..

#

WHAT ARE U TYPING

eternal charm
#
Root.CFrame = spawnport.CFrame + Vector3.new(0, 5, 0)
UI.Visible = false
for i = 1, 3 do
  Players.Value = i - 1
  game.ReplicatedStorage["plr"..i].Value = false
end
little beacon
#

HOLLY

eternal charm
#

this

little beacon
#

o

eternal charm
#

but i see a problem

#

youre trying to change a replicated value from a local script?

little beacon
#

Yep

#

That isnt the problem tho

#

that works

#

but

#

the problem is the server script

#

that when u touch the part

#

it gives 1 and u cant get more then 3 so

#

yea

eternal charm
little beacon
#

It does look at the vid i send

eternal charm
#

the server doesnt receive that change

eternal charm
#

its not what the server sees

little beacon
#

Oh

#

So if i join in game it will work diffrent?

eternal charm
#

.????

#

do you understand server and client environments?

little beacon
#

I mean ik whats server and client but i didnt read enviroments

grave arch
#

while skibidi do hawk the tuah end

eternal charm
#

rea

#

l

eternal charm