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 make ownership a valid member of part

Previous Thread :: Next Thread 
Astro1282 is not online. Astro1282
Joined: 06 Aug 2009
Total Posts: 471
19 Aug 2015 05:45 AM
local one = Workspace.one
one.ownership = 0 --Sets one ownership to 0

function onClicked(playerWhoClicked)

script.Parent.connect(ownership)-- To activate function ownership()

end


function ownership() --function

ownership=1 --sets one ownership to 1
if one.ownership==1
then print("YES") --prints YES if one ownership is = to 1
end

end

How do I make ownership a property of the part called one?
Report Abuse
Twistir is not online. Twistir
Joined: 19 Nov 2009
Total Posts: 12374
19 Aug 2015 05:49 AM
Do parts have an ownership property..?
http://wiki.roblox.com/index.php?title=API:Class/Part


ε:
Report Abuse
Astro1282 is not online. Astro1282
Joined: 06 Aug 2009
Total Posts: 471
19 Aug 2015 05:51 AM
So one.ownership = 0 is never possible?
Report Abuse
Twistir is not online. Twistir
Joined: 19 Nov 2009
Total Posts: 12374
19 Aug 2015 05:52 AM
No, but what are you trying to do? Are you trying to parent 'one'? Are you trying to parent something to 'one'?


ε:
Report Abuse
Astro1282 is not online. Astro1282
Joined: 06 Aug 2009
Total Posts: 471
19 Aug 2015 05:54 AM
My error is ownership is not a valid member of Part. What I am trying to do is that when clicked ownership would = to 1. When = to 1 console should print YES.
Report Abuse
76km is not online. 76km
Joined: 14 Aug 2015
Total Posts: 5455
19 Aug 2015 05:58 AM
he is trying to make it owned by someone...

you could do:

part.Name = player.Name - that could work.

if you want to parent and move it

part.Parent = whatitisunder

>Essaying and foruming at same time, fun days
Report Abuse
Astro1282 is not online. Astro1282
Joined: 06 Aug 2009
Total Posts: 471
19 Aug 2015 06:03 AM
Very new to this lua scripting.

function onClicked(playerWhoClicked)

script.Parent.connect(ownership)-- To activate function ownership()

end

Does the code above activate function ownership() when clicked?
Report Abuse
76km is not online. 76km
Joined: 14 Aug 2015
Total Posts: 5455
19 Aug 2015 06:11 AM
nope, that won't work. its a function and it will never fire.

The bottom line (this is for when you touch bricks) needs to be like this.

function abuse(hit)
--commands
end

script.Parent.Touched:connect(abuse)

that will activate when touched

>Essaying and foruming at same time, fun days
Report Abuse
Astro1282 is not online. Astro1282
Joined: 06 Aug 2009
Total Posts: 471
19 Aug 2015 06:15 AM
ownership = 0 --Sets one ownership to 0

function onClicked(playerWhoClicked) --function

ownership=1 --sets one ownership to 1
if ownership==1
then print("YES") --prints YES if one ownership is = to 1
end

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Did some reading and apparently fixed it. Thanks mate!
Report Abuse
Astro1282 is not online. Astro1282
Joined: 06 Aug 2009
Total Posts: 471
19 Aug 2015 06:16 AM
Is there anyway to activate a function from another function?
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