#RemoteEvents Error
135 messages · Page 1 of 1 (latest)
Is the for i player in pairs 100% necessary
i dont know other way
👍
delete.
?
i do not understand
Because you are making question visible for server
oh right
** You are now Level 9! **
so do i include everything

inside the for i
Inside OnClientEvent
how to make a function run ones
local Part = 0
function lol()
local Part = Instance.new("Part", game.Workspace)
Part.Size = Vector3.new(2, 4, 4)
Part.Position = Vector3.new(27, 4, -46)
Part.Color = Color3.new(1, 0, 0)
Part.Anchored = true
Part.Material = Enum.Material.Plastic
Part.Shape = Enum.PartType.Cylinder
print("done")
end
game.Workspace.Part1.TouchEnded:Connect(lol)```
i want this function to run ones when i touched the block
nvm
** You are now Level 2! **
NOT YOUR POST
for _, player in arrayofspecificplayers do
RemoteEvent:FireClient(player, whatever)
end
while true do
local sendQuestions = game.ReplicatedStorage.SendQuestion
for i, player in plrs do
sendQuestions:FireClient(player)
end
wait(18)
end
it doesnt work
how are you inserting the players into the plrs table
local plrs = {}
for i, player in pairs(game.Players:GetPlayers()) do
if player then
table.insert(plrs, player) -- Add current players into a table
end
end
its functionable because they get tped afterwards
(the players in the table)
why are you checking if player
idk
player would never be nil because game.Players:GetPlayers() always returns a table full of connected and existing players
👍
also if your just inserting every player you might as well just fire the remote event in there
for i, player in game.Players:GetPlayers() do
sendquestion:FireClient(player)
end
it's not for every player
it's for players in the table
basically players that are in the game and NOT in the lobby
so how are you differentiating both
well if a player joins they wont be included in the table
because theres a match going on
i do this so stuff that appear in game doesnt appear to people in the lobby
yes the code i sent accounts for that
you probs also need like an event to even validate a player to be placed into the table
like when player presses a play button you know they fully loaded in
i dont think theres any problem with that
as i told you every other function works with that players table
like tping the players
this?
yes
for i, player in game.Players:GetPlayers() do
if playerisinlobby then continue end
sendquestion:FireClient(player)
end
do a check
dont get stumped because i gave you pseudo code that is only meant to give you an idea
oh i get what u mean
ill test and let you know if it owrks
@ivory wraith doesnt work
prob has to do something with the onclientevent script
local question = script.Parent
local questionsTable = {
"What is your favorite color?";
"eeeee"
}
local randomNumber = math.random(1, #questionsTable)
local randomQuestion = questionsTable[randomNumber]
game.ReplicatedStorage.SendQuestion.OnClientEvent:Connect(function()
local questionsLabel = game.StarterGui.Question.TextLabel
questionsLabel.Visible = true
question.Text = randomQuestion
wait(15)
questionsLabel.Visible = false
wait(3)
question.Text = randomQuestion
end)
do not use startergui
it will not update
use playergui - the live gui container that a player can see all their guis in
also put the randomizer inside the onclient event to always generate a random one when the event fires
local PlayerGui = game.Players.LocalPlayer.PlayerGui
local questionsLabel = PlayerGui:WaitForChild("Question").TextLabel
game.ReplicatedStorage.SendQuestion.OnClientEvent:Connect(function()
local randomNumber = math.random(1, #questionsTable)
local randomQuestion = questionsTable[randomNumber]
questionsLabel.Visible = true
question.Text = randomQuestion
task.wait(15)
questionsLabel.Visible = false
task.wait(3)
question.Text = randomQuestion
end)
??
Go make your own post
This is not your post
This is someone else's
do you see that every time the event fires, the random question will ALWAYS be the same
after the first time
OHH u made me understand thx u man
right but what is happening now is that the question is different to every client
it's supposed to be the same one
how do I fix that
@ivory wraith ^
yeah
because its supposed to be i, players in pairs(players) ddo
Can u try generating the random question on the server and then sending that to all the clients
bro
"bro" 🤓
Anime pfp, you get no girls
Bro calls himself "intermediate at scripting" but cant figure out remote events 😭
holy shit people in here got a big ass ego
LMAO
man got a super cringe quote as about me and is complaining about my pfp
It's from a meme 💀 like what are you on
You play fortnite, you can't judge anyone else anime kid
LMAO
sorry mate, didn't know people who play fortnite for fun and watch anime sometimes are kids!!!

Mostly yes
then i could perfectly say why are you guys wasting time scripting games for 8 y old kids to play them
anyway no point on enlarging the argument
Don't worry, we all know you're a kid with a lack of friends 😩
the fuck you on kid?
is really your way of trying to insult others saying they lack of friends? LMAO
tbh pretty ridiculous
This topic went out of hand quick
** You are now Level 32! **
Level 32 😩
I can't help you if your not even sure what to do with the advice i give
LMFAO
i asked for something
but i dont get why you would complain about me asking
simply dont answer then
you are totally not the one that started calling me a kid
this isn't even your convo man
I gave you multiple advice on your issue
He gave you advice, and you replied with a nerd emoji 💀
Embarassing
saying bro after that looks like he's mad to answer that
How 💀
"can you try doing this"
** You are now Level 10! **
"dude"