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: Help with GUI while FE is enabled

Previous Thread :: Next Thread 
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 09:35 AM
For some odd cause this isn't firing when I press the button

// This is a ScreenGui with a TextButton in it. All located in StarterGui

script.Parent.MouseButton1Down:connect(function()
game.Workspace.MyEvent:FireServer()
end)


// This is a normal script, located in ServerScriptService

local event = Instance.new("RemoteEvent")
event.Name = "baseplate"
event.Parent = game.Workspace
event.OnServerEvent:connect(function(p)
game.Workspace.Baseplate.BrickColor = BrickColor.random()
p.PlayerGui.ScreenGui.TextButton.BackgroundColor3 = game.Workspace.Baseplate.Color
end)


Maybe it has something to do with the OnClicked part of the script thats in TextButton? I'm not sure.. I'm trying to learn how FE works so :P
Report Abuse
Dratik is online. Dratik
Joined: 13 Nov 2008
Total Posts: 36385
18 Jul 2017 10:00 AM
Your event is named "baseplate" and you're looking for the event "MyEvent"


Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 10:04 AM
@Dratik Indeed, I recognized zed problem and changed it via ROBLOX Studio, doesn't fix my dilemma nonetheless.
Report Abuse
6l8 is not online. 6l8
Joined: 17 Jun 2014
Total Posts: 4055
18 Jul 2017 10:05 AM
Server can't access playerGui.


Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 10:07 AM
@6l8 What would I apply to access PlayerGui?
Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
18 Jul 2017 10:08 AM
Use a local script
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 10:11 AM
@RogueMage

Within which script? How would this improve anything in general?
Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
18 Jul 2017 10:12 AM
Local script instead of a server script when it's parented to the GUI


Local scripts allow you to access localplayer and other cool things


wiki.roblox.com/index.php?title=API:Class/LocalScript

forum.roblox.com/Forum/ShowPost.aspx?PostID=36810971
Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
18 Jul 2017 10:20 AM
First of all you should place your remote events into Replicated storage and not Workspace. When FE you cant access PlayerGui from server script i think. So you should do it like that.

-- Server script --
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local bcEvent = Instance.new("RemoteEvent", ReplicatedStorage.Network)
bcEvent.Name = "bcEvent"

bcEvent.OnServerEvent:connect(function(player)
game.Workspace.Baseplate.BrickColor = BrickColor.random()
end)

-- Local script --
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local bcEvent = ReplicatedStorage:WaitForChild("bcEvent")

script.Parent.MouseButton1Click:connect(function()
bcEvent:FireServer()
end)

game.Workspace.Baseplate.Changed:connect(function()
script.Parent.BackgroundColor3 = game.Workspace.Baseplate.Color
end)
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 10:26 AM
Aghh this #### is confusing. Thanks for all the help tho RogueMage.
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 10:31 AM
99XxXLuKaXxX99

Your script doesn't run for some unusual reason.
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 10:47 AM
.
Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
18 Jul 2017 11:21 AM
It worked for me.

You put local script in the button, and server script into ServerScriptStorage
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 11:23 AM
ServerScriptService you mean? Or ServerStorage?
Report Abuse
iiNemo is online. iiNemo
Joined: 22 Jul 2013
Total Posts: 2380
18 Jul 2017 11:24 AM
Put the remote event in the replicated storage first of all
Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
18 Jul 2017 11:24 AM
Ohh sory I forgot to remove Nerwork.

in server script where you create a Remote event do this.

old:

local bcEvent = Instance.new("RemoteEvent", ReplicatedStorage.Network)

It doesn't work because the parent is set to Network ( I usually store my events in Network folder and that's why I accidently put it there )

new:
local bcEvent = Instance.new("RemoteEvent", ReplicatedStorage)
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 11:26 AM
I had to put it in ServerScriptService, thanks man <3
Report Abuse
gmatch is not online. gmatch
Joined: 21 May 2014
Total Posts: 1173
18 Jul 2017 11:29 AM
Could you add my discord? I have a few questions about FE

Discord - Goat#2976
Report Abuse
99XxXLuKaXxX99 is not online. 99XxXLuKaXxX99
Joined: 22 Jul 2012
Total Posts: 122
18 Jul 2017 11:30 AM
Np, remember to put all your events into ReplicatedStorage cuz putting them in workspace is not good practice ;D
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