generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Remote event doesn't work as it should..?

Previous Thread :: Next Thread 
Gofven is not online. Gofven
Joined: 18 Jun 2015
Total Posts: 767
06 Sep 2017 01:40 PM
Im not sure but it seems like RemoteEvent doesn't work at all, here's the base codes on wiki which... doesnt work either... :

Server:

local Players = game:GetService("Players")

local newPlayerEvent = Instance.new("RemoteEvent")
newPlayerEvent.Parent = game.ReplicatedStorage
newPlayerEvent.Name = "NewPlayer"

local function onPlayerAdded(player)
newPlayerEvent:FireAllClients()
end

Players.PlayerAdded:Connect(onPlayerAdded)



Client:

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

local player = Players.LocalPlayer
local newPlayerEvent = ReplicatedStorage:WaitForChild("NewPlayerEvent")
local playerGui = player:WaitForChild("PlayerGui")

local welcomeScreen = Instance.new("ScreenGui")
welcomeScreen.Parent = playerGui
local newPlayerMessage = Instance.new("TextLabel")
newPlayerMessage.Size = UDim2.new(0, 200, 0, 50)
newPlayerMessage.Parent = welcomeScreen
newPlayerMessage.Visible = false
newPlayerMessage.Text = "A new player has joined the game!"

local function onNewPlayerFired()
newPlayerMessage.Visible = true
wait(3)
newPlayerMessage.Visible = false
end

newPlayerEvent.OnClientEvent:Connect(onNewPlayerFired)
Report Abuse
Gofven is not online. Gofven
Joined: 18 Jun 2015
Total Posts: 767
06 Sep 2017 02:09 PM
urgent bump
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
06 Sep 2017 02:24 PM
you dont even need a remote event for this task


Report Abuse
fun4nerd is online. fun4nerd
Joined: 30 Oct 2013
Total Posts: 4440
06 Sep 2017 02:26 PM
lol you dont need remote event for this, you dumb?


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
06 Sep 2017 02:31 PM
yes but that's irrelevant

just set up a playeradded event on the client duh


Report Abuse
fun4nerd is online. fun4nerd
Joined: 30 Oct 2013
Total Posts: 4440
06 Sep 2017 02:32 PM
I was talking to op not you wrath


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
06 Sep 2017 02:37 PM
ok


Report Abuse
DailyHD is not online. DailyHD
Joined: 07 Jan 2016
Total Posts: 2504
07 Sep 2017 09:00 AM
Rip
Report Abuse
Gofven is not online. Gofven
Joined: 18 Jun 2015
Total Posts: 767
07 Sep 2017 05:03 PM
Huh... Maybe that was too simple... The point is that it doesn't run correctly, it throws errors at me, anyone tell me why?

its not only for this trash, its also for future use when i need to run it ingame rather than when player joins.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image