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
|
  |
| 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
|
  |
| Joined: 06 Aug 2009 |
| Total Posts: 471 |
|
|
| 19 Aug 2015 05:51 AM |
| So one.ownership = 0 is never possible? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|