all_Dev
|
  |
| Joined: 16 Dec 2011 |
| Total Posts: 1854 |
|
|
| 19 Jan 2017 09:10 PM |
I do plan on adding my own stuff later, in the meantime I need to use them for testing.
http://www.roblox.com/Westworld-item?id=525246965 |
|
|
| Report Abuse |
|
|
crome60
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 15266 |
|
|
| 19 Jan 2017 09:21 PM |
local torso = p.Character.Torso
Literally just define the torso. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2017 09:21 PM |
Instead of telling you to "do it on your own", I'm gonna do it, and then explain what I did(While staying true to your style of scripting).
function onClicked(mouse) if on then p = game.Players.LocalPlayer if (p == nil) then return end if (p.Character == nil) then return end if (mouse.hit.p - Torso.cframe.p).magnitude < 20 then Now something I'd rather do would be:
function onClicked(mouse) if on then p = game:GetService("Players").LocalPlayer --There has to be a localplayer if this is in a localscript. if not p.Character then return end --Just incase there's a script that removes the character if (mouse.hit.p - Torso.cframe.p).magnitude < 20 then --Remember that Torso is capitalized, and scripting is case-sensitive. If you have anymore questions, feel free to ask.
I'm Batman |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2017 09:22 PM |
One more thing: Capitalize CFrame.
I'm Batman |
|
|
| Report Abuse |
|
|
LuluPls
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1221 |
|
|
| 19 Jan 2017 09:24 PM |
You can't call yourself a developer when you use things that others make and put them together, and as you say "earn money" off their hard work. As for your second argument, I did not help because all you have to do is:
1. Go to google 2. write "attempt to index a nil value roblox" 3. Click on one of the various links that show up 4. Yay, now you know what the error means and how to fix it, now you don't have to go on forums and waste everyone's time!
R$0 |
|
|
| Report Abuse |
|
|
all_Dev
|
  |
| Joined: 16 Dec 2011 |
| Total Posts: 1854 |
|
|
| 19 Jan 2017 09:29 PM |
Thanks for helping out @antonio and @crome! I figured it out already, thanks to a friend.
http://www.roblox.com/Westworld-item?id=525246965 |
|
|
| Report Abuse |
|
|