#RemoteEvents Error

135 messages · Page 1 of 1 (latest)

sharp birch
#
for i,player in players do
  FireClient(player)
end
brazen dome
sharp birch
brazen dome
#

👍

sharp birch
#

delete.

hybrid fulcrum
#

?

sharp birch
#

make new

hybrid fulcrum
#

i do not understand

brazen dome
#

@sharp birch

#

it's only sent to the server

#

not client

sharp birch
brazen dome
#

oh right

pallid jewel
#

studio** You are now Level 9! **studio

brazen dome
#

so do i include everything

sharp birch
brazen dome
#

inside the for i

sharp birch
hybrid fulcrum
#

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

pallid jewel
#

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

ivory wraith
#
for _, player in arrayofspecificplayers do
   RemoteEvent:FireClient(player, whatever)
end
brazen dome
#

it doesnt work

ivory wraith
#

how are you inserting the players into the plrs table

brazen dome
#
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)

ivory wraith
#

why are you checking if player

brazen dome
#

idk

ivory wraith
#

player would never be nil because game.Players:GetPlayers() always returns a table full of connected and existing players

brazen dome
#

👍

ivory wraith
#

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
brazen dome
#

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

ivory wraith
#

so how are you differentiating both

brazen dome
#

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

ivory wraith
#

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

brazen dome
#

as i told you every other function works with that players table

#

like tping the players

ivory wraith
#

ok cool

#

then that should work

ivory wraith
#

yes

brazen dome
#

that would appear to players in the lobby

#

the event

#

which is not meant to happen

ivory wraith
#

so you should differentiate both players in lobby and not in lobby

#

like

brazen dome
#

thats the table...

#

like the players table is the players that are playing right now

ivory wraith
#
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

brazen dome
#

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)
ivory wraith
#

do not use startergui

#

it will not update

#

use playergui - the live gui container that a player can see all their guis in

ivory wraith
# brazen dome ```lua local question = script.Parent local questionsTable = { "What is you...

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)
brazen dome
#

question.Text = randomQuestion

#

Is already in the event

#

so no sense really

hybrid fulcrum
snow smelt
#

This is not your post

#

This is someone else's

ivory wraith
#

after the first time

hybrid fulcrum
brazen dome
#

it's supposed to be the same one

#

how do I fix that

brazen dome
#

@ivory wraith ^

sly crown
# brazen dome

because its supposed to be i, players in pairs(players) ddo

ivory wraith
#

bro

brazen dome
#

"bro" 🤓

snow smelt
#

Bro calls himself "intermediate at scripting" but cant figure out remote events 😭

brazen dome
#

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

snow smelt
#

You play fortnite, you can't judge anyone else anime kid

brazen dome
#

LMAO

#

sorry mate, didn't know people who play fortnite for fun and watch anime sometimes are kids!!!

brazen dome
#

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

snow smelt
brazen dome
#

the fuck you on kid?

#

is really your way of trying to insult others saying they lack of friends? LMAO

#

tbh pretty ridiculous

snow smelt
#

👻 👻 👻 👻

ivory wraith
#

This topic went out of hand quick

pallid jewel
#

studio** You are now Level 32! **studio

snow smelt
ivory wraith
snow smelt
#

LMFAO

brazen dome
#

i asked for something

#

but i dont get why you would complain about me asking

#

simply dont answer then

brazen dome
#

this isn't even your convo man

ivory wraith
#

I gave you multiple advice on your issue

snow smelt
#

Embarassing

brazen dome
#

saying bro after that looks like he's mad to answer that

brazen dome
#

"can you try doing this"

pallid jewel
#

studio** You are now Level 10! **studio

brazen dome
#

"dude"

snow smelt
#

How does that make you sound mad

#

I think you may need to socialize more, because calling someone "bro" doesn't make you sound mad to normal people 💀

brazen dome
#

yeah you aint gonna tell me what i find good or not

#

lets just end this here no point on debating