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: LuaLearners Advanced Assignment

Previous Thread :: Next Thread 
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
18 Oct 2012 02:52 PM
There's a lot I don't know... I'm probably way off. Here's my script:

Approved = {"1cooldude361"}

for i, v in pairs(Approved) do
function hit(h)
p = game.Workspace:GetChildren()
for i= 1, #p do
if p.ClassName == "Part" then
Instance.new("Message", game.Workspace).Text = h.Parent.Name.." broke this place."
p.CFrame = Vector3.new(.9, .9, .9)
elseif
a = game.Players:GetPlayerFromCharacter(h.Parent)
Instance.new("Message", a.Camera).Text = "Go away!"
end
end
end
end

script.Parent.Touched:connect(hit)


Yeah, I was pretty close, I just looked at output in the script. What would I say for someone to not be approved? That would be everyone other than me, so... And I'm not sure how to make something only viewable by that person. I just wanted to insert it into a certain player's camera.

Tactical Rainboom Inbound
Report Abuse
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
18 Oct 2012 02:57 PM
Bump.

Tactical Rainboom Inbound
Report Abuse
1cooldude361 is not online. 1cooldude361
Joined: 13 Mar 2010
Total Posts: 4403
18 Oct 2012 03:10 PM
Help.

Tactical Rainboom Inbound
Report Abuse
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
18 Oct 2012 03:22 PM
You can only access a players camera through the use of a LocalScript.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
18 Oct 2012 03:27 PM
You should test if whatever touched the brick is a player before using the script

Also, to access the table of parts in the Workspace, you need to include the index ('p' should be 'p[i]')

And, as Leo said, the script must be Local to access the Player's Camera.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
18 Oct 2012 03:28 PM
also, you should put an 'end' where you wrote 'elseif', as it's not needed in this script.
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