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
 

Whats Wrong With This Script?

Previous Thread :: Next Thread 
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 09:43 PM
g = game.Workspace.RoomBlockOwner

script.Parent.MouseButton1Down:connect(function(player)
if player.Name == "epicpatrick123" then
g.BrickColor = BrickColor.new("Dark stone grey")
g.Transparency = 1
g.CanCollide = true
else
print("idk")
end
end)
Report Abuse
TheLuaNoob is not online. TheLuaNoob
Joined: 04 May 2012
Total Posts: 482
05 May 2012 09:45 PM
You need to tell use what it should do first.

~!~ Plus One Post ~!~
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 09:47 PM
When you click on the gui, it does what the script has in it...
Report Abuse
ozza is not online. ozza
Joined: 11 Oct 2007
Total Posts: 726
05 May 2012 09:48 PM
It's because I was wrong in assuming player could be a parameter, put this in a localscript


g = game.Workspace.RoomBlockOwner
local play = game.Players.LocalPlayer

script.Parent.MouseButton1Down:connect(function(player)
if play.Name == "ozza" then
g.BrickColor = BrickColor.new("Dark stone grey")
g.Transparency = 1
g.CanCollide = true
else
print("idk")
end
end)
Report Abuse
jimjim37 is not online. jimjim37
Joined: 31 May 2009
Total Posts: 23
05 May 2012 09:51 PM
try this

g = game.Workspace.RoomBlockOwner

script.Parent.MouseButton1Down:connect(function)(player)
if player.Name == "epicpatrick123" then
g.BrickColor = BrickColor.new("Dark stone grey")
g.Transparency = 1
g.CanCollide = true
else
print("idk")
end
end)


Report Abuse
ozza is not online. ozza
Joined: 11 Oct 2007
Total Posts: 726
05 May 2012 10:04 PM
@ jimjim, please don't post scripts if you have absolutely no idea what you're talking about.
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 10:24 PM
Works, and can you add more than one person onto it?
Report Abuse
TheLuaNoob is not online. TheLuaNoob
Joined: 04 May 2012
Total Posts: 482
05 May 2012 10:26 PM
if player.Name == "epicpatrick123, Name2, Name3, Name4, Name5" then

~!~ Plus One Post ~!~
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 10:27 PM
ok and can it work in play mode?
Report Abuse
TheLuaNoob is not online. TheLuaNoob
Joined: 04 May 2012
Total Posts: 482
05 May 2012 10:29 PM
It should.

~!~ Plus One Post ~!~
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 10:29 PM
is there a way to make it work in play?
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 10:30 PM
local play = game.Players.LocalPlayer

i think that's the problem
Report Abuse
TheLuaNoob is not online. TheLuaNoob
Joined: 04 May 2012
Total Posts: 482
05 May 2012 10:32 PM
Is it not working in play?

Did you try it?

~!~ Plus One Post ~!~
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 10:34 PM
Works in build, not in play. i tested it.
Report Abuse
TheLuaNoob is not online. TheLuaNoob
Joined: 04 May 2012
Total Posts: 482
05 May 2012 10:38 PM
if player.Name == "epicpatrick123" or "Name1" or "Name2" or "Name3" then

~!~ Plus One Post ~!~
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
05 May 2012 10:40 PM
gtg, maybe you can see why it doesn't work? i put that in and it just broke it...
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
06 May 2012 07:17 AM
bump anyone it only works in building mode, can anyone fix that?
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
06 May 2012 07:22 AM
g = game.Workspace.RoomBlockOwner
plr = Game.Players.LocalPlayer

script.Parent.MouseButton1Down:connect(function()
if plr.Name == "epicpatrick123" then
g.BrickColor = BrickColor.new("Dark stone grey")
g.Transparency = 1
g.CanCollide = true
else
print("idk")
end
end)

Put that inside a Localscript inside a Child of Player Object
1) A PlayerGui Object
2) A Tool or Hopperbin


Velibor
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
06 May 2012 07:25 AM
Put that inside a Localscript inside a Child of Player Object
1) A PlayerGui Object
2) A Tool or Hopperbin

????????????
Report Abuse
ozza is not online. ozza
Joined: 11 Oct 2007
Total Posts: 726
06 May 2012 07:26 AM
It needs to be in a gui.


g = game.Workspace.RoomBlockOwner
plr = Game.Players.LocalPlayer

script.Parent.MouseButton1Down:connect(function()
if plr.Name == "epicpatrick123" or plr.Name == "ozza" then
g.BrickColor = BrickColor.new("Dark stone grey")
g.Transparency = 1
g.CanCollide = true
else
print("idk")
end
end)
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
06 May 2012 07:27 AM
That means put the LocalScript inside your GUI !

Velibor
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
06 May 2012 07:29 AM
vliber yours still only works in build mode
Report Abuse
ozza is not online. ozza
Joined: 11 Oct 2007
Total Posts: 726
06 May 2012 07:30 AM
If his still only works in build mode, then that must be user error. It works fine for me.
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
06 May 2012 07:32 AM
maybe i went into an old server? idk ill try again
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
06 May 2012 07:36 AM
Allow = {"epicpatrick123"}

script.Parent.MouseButton2Down:connect(function()
if Game.Players.LocalPlayer.Name == Allow[1] then
local Brick = Game:GetService("Workspace")["RoomBlockOwner"]
Brick.BrickColor = BrickColor.new(199)
Brick.Transparency = 1
Brick.CanCollide = true
end
end)

If that doesn't work then I don't know what is causing the Problem..


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