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: Not a valid member of workspace?

Previous Thread :: Next Thread 
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 08:45 PM
Script:

local re = Instance.new("RemoteEvent",workspace)
local re2 = Instance.new("RemoteEvent",workspace)
re.Name = "Open"
re2.Name = "Close"
re.OnServerEvent:connect(function()
for i = 1,8 do
wait(.5)
workspace.Gate:TranslateBy(Vector3.new(0,1,0))
end
end)
re2.OnServerEvent:connect(function()
for i = 1,8 do
wait(.5)
workspace.Gate:TranslateBy(Vector3.new(0,-1,0))
end
end)




Local script:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

repeat
wait()
until
mouse.Target == workspace.ButtonUp
if mouse.Target == workspace.ButtonUp then
local debounce = false
mouse.Button1Down:connect(function()
if debounce == false then
debounce = true
workspace.Open:FireServer()
end
end)
debounce = false
end
repeat
wait()
until
mouse.Target == workspace.ButtonDown
if mouse.Target == workspace.ButtonDown then
local debounce = false
mouse.Button1Down:connect(function()
if debounce == false then
debounce = true
workspace.Close:FireServer()
end
end)
end end
end)
end

Pictures:
Log of the console:
https://twitter.com/MyActiveAlts/status/819011110376308738
Heirarchy proof of existance:
https://twitter.com/MyActiveAlts/status/819012066501500928

Why
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
10 Jan 2017 08:51 PM
I recommend putting RemoteEvent's in replicatedstorage:

local replicatedstorage = game:GetService('ReplicatedStorage')
local event = replicatedstorage:WaitForChild('RemoteEvent')
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 08:56 PM
I even tried opening a new place and trying it there.
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Jan 2017 09:00 PM
workspace:WaitForChild("ButtonUp")
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 09:01 PM
It wouldnt work at all if I did that because I tried
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Jan 2017 09:06 PM
if you get the possible infinite yield error, then maybe the part does not exist for whatever reason

if you don't, then your script should work if you add the waitforchild at the beginning of the script
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
10 Jan 2017 09:07 PM
You sure? Try storing ButtonUp and ButtonDown as variables at the top of your script.

local ButtonUp = workspace:WaitForChild("ButtonUp")
local ButtonDown = workspace:WaitForChild("ButtonDown")


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 09:24 PM
^ Thats what I did
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
10 Jan 2017 09:30 PM
Did you get the possible infinite yield warning or what?


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 09:32 PM
No the only warning I got is in the console picture saying it doesnt exist. That was in game
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
10 Jan 2017 09:36 PM
If you have a waitforchild then it shouldn't say it doesn't exist .-.


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 09:41 PM
New script

https://twitter.com/MyActiveAlts/status/819026168682713088
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 09:45 PM
the only thing that creates an infinite yeild is WaitForChild()
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 09:50 PM
Im sure this isnt it but maybe because im not using a click detector with a remote event?
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
10 Jan 2017 10:10 PM
Wrath Can I give you the place and you see if it works for you?
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
10 Jan 2017 10:19 PM
Sure, just add me to team create and I'll see what I can do


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
11 Jan 2017 02:21 PM
Okay, looking at this in an editor it's clearer why this might not work. A lot of the code here was simply unnecessary, I'm going to edit the code and paste bin it back to you.


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
11 Jan 2017 02:21 PM
Ok
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
11 Jan 2017 02:28 PM
pmed


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
11 Jan 2017 02:29 PM
store remote events in replicated storage, not workspace


Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
11 Jan 2017 03:27 PM
^ That's what I exactly said.
Report Abuse
myactivetestplace is not online. myactivetestplace
Joined: 11 Jul 2015
Total Posts: 3733
11 Jan 2017 03:28 PM
YA THATS WHAT HE EXACTLY SAID STOP STEALING HIS IMPUT OK? x
Report Abuse
Bobby_Darin is not online. Bobby_Darin
Joined: 05 Jan 2013
Total Posts: 5587
11 Jan 2017 03:30 PM
"store remote events in replicated storage, not workspace"

has nothing to do with his problem and doesn't matter anyway
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
11 Jan 2017 04:26 PM
###### We only said it's recommended to store remoteEvents in replicatedstorage. We didn't say it was the problem..
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
11 Jan 2017 04:27 PM
^^
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