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 » Scripting Helpers
Home Search
 

Re: Script Works in Play Solo, But Not Online

Previous Thread :: Next Thread 
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
25 Apr 2014 04:50 PM
This is a local script in a brick:

local ting = 0
function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
game.Lighting.GUI1:clone().Parent = game.Players.LocalPlayer.PlayerGui
wait(5)
game.Players.LocalPlayer.PlayerGui.GUI1:remove()

ting = 0
end
end
end
script.Parent.Touched:connect(onTouched)
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
25 Apr 2014 04:52 PM
repeat wait() until game.Players.LocalPlayer

at the top^
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
25 Apr 2014 04:53 PM
"a LOCAL SCRIPT in a brick"
There's your problem, it's a local script. Change it to a regular script and edit the script accordingly.

Here's my siggy... Done.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
25 Apr 2014 04:56 PM
So, if I put it in normal script and do what sensei said, should it work?
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
25 Apr 2014 04:56 PM
What I said usually works for Local Scripts..
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
25 Apr 2014 04:57 PM
@Sensei But he's got a local script in a brick. You can only have local scripts working when they're descendants of the player.

Here's my siggy... Done.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
25 Apr 2014 04:58 PM
PlayerGui is a descendant of the player.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
25 Apr 2014 04:59 PM
@youssef Where is the script? I know it's in a brick, but where?

Here's my siggy... Done.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
25 Apr 2014 04:59 PM
the SCRIPT isnt
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
25 Apr 2014 05:01 PM
Workspace.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
25 Apr 2014 05:02 PM
@youssef Make the local script a regular script and edit it accordingly. Local scripts don't run unless their parent is a descendant of the player or the player itself.

Here's my siggy... Done.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
25 Apr 2014 05:02 PM
Ok.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
25 Apr 2014 05:03 PM
http://wiki.roblox.com/index.php?title=RBX.lua.LocalScript_(Object)
For further reading. :P

Here's my siggy... Done.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
25 Apr 2014 05:08 PM
if check ~= nil then
ypcall(function()
game.Lighting.GUI1:clone().Parent = game.Players[hit.Parent.Name].PlayerGui
end)
end
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
25 Apr 2014 05:17 PM
I decided to make it a hunt for faces and make it a 1 player server. So it "Injects" GUI1 into StarterGui, but it still doesn't work.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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