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: clickdetector problem

Previous Thread :: Next Thread 
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 09:12 PM
uhh the tower isnt spawning?

function onClicked(p)
local val = p:WaitForChild("SelectedItem")
if val.Value == "Test" then
if script.Parent.IsUsed == false then
local tower = game.ReplicatedStorage.Towers.Tower
local st = tower:Clone()
st.Parent = workspace
st:MoveTo(script.Parent.Position + Vector3.new(0,3,0))
wait()
script.Parent.IsUsed.Value = true
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


whats gonna work, teamwork!
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
25 Mar 2017 09:14 PM
st.Parent = game.Workspace


are you not ENTERTAINED!??!
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 09:17 PM
22:16:50.259 - ###################################### attempt to index global 'moveHandles' (a nil value) ############ - Stack Begin 22:16:50.260 - Script #################################### Line 199 22:16:50.260 - Stack End whats gonna work, teamwork!
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
25 Mar 2017 09:19 PM
try posting again
this time, copy it first, preview, look at what got filtered, and repost with x's before all filtered terms


are you not ENTERTAINED!??!
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 09:24 PM
22:16:50.259 - Plugin_604x7x9x6x0x8x5.Terrain_Generate:xx1xx99: attempt to index global 'moveHandles' (a nil value) 2x2:x1x6:x50.x26x0 - Stack Begin 2x2:x1xx6:x50.260 - Script 'Plugin_6x0x47xxxx96x0xx85.Txexrrxaixn_Gexnxerxxaxte', Line ##### ################## - Stack End whats gonna work, teamwork!
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 09:24 PM
lets just say it literally has nothing to do with my script and that was the only error


whats gonna work, teamwork!
Report Abuse
LuluPls is not online. LuluPls
Joined: 23 Aug 2010
Total Posts: 1221
25 Mar 2017 09:33 PM
that means "moveHandles" doesn't exist.


Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 09:44 PM
but it doesnt relate to my script at all


whats gonna work, teamwork!
Report Abuse
KenUSM is not online. KenUSM
Joined: 21 Nov 2015
Total Posts: 146
25 Mar 2017 09:48 PM
It's most likely the

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

if no errors show.
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 10:07 PM
local click = Instance.new("ClickDetector",script.Parent)

click.MouseClick:connect(function(p)
local val = p:WaitForChild("SelectedItem")
if val.Value == "Test" then
if script.Parent.IsUsed == false then
local tower = game.ReplicatedStorage.Towers.Tower
local st = tower:Clone()
st.Parent = game.Workspace
st:MoveTo(script.Parent.Position + Vector3.new(0,3,0))
wait()
script.Parent.IsUsed.Value = true
end
end
end



whats gonna work, teamwork!
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 10:10 PM
23:07:24.451 - Workspace.SelectTile.Script:16: ')' expected (to close '(' at line 3) near 'eof'


whats gonna work, teamwork!
Report Abuse
Ben1925 is not online. Ben1925
Joined: 07 Apr 2011
Total Posts: 741
25 Mar 2017 10:10 PM
Print statements everywhere, see where the script is flowing.
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
25 Mar 2017 10:12 PM
^ do that after every 'argument', put print("1"), then ########### ### #### ### you can see what numbers it prints and find out where it stopped are you not ENTERTAINED!??!
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
25 Mar 2017 10:13 PM
I am going to strangle whoever decided these filters were smart.

^ do that
after first arg: print("1")
second : print("2")

etc etc
that way you can determine exactly where it went wrong


are you not ENTERTAINED!??!
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 10:15 PM
function onClicked(p)
print("Clicked")
local val = p:WaitForChild("SelectedItem")
if val.Value == "Test" then
print("is test")
wait()
if script.Parent.IsUsed == false then
local tower = game.ReplicatedStorage.Towers.Tower
wait()
local st = tower:Clone()
print("cloing tower")
wait()
st.Parent = game.Workspace
print("parent is workspace")
wait()
st:MoveTo(script.Parent.Position + Vector3.new(0,3,0))
print("moved")
wait()
script.Parent.IsUsed.Value = true
print("value is true")
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)


stopped at "Clicked"


whats gonna work, teamwork!
Report Abuse
KenUSM is not online. KenUSM
Joined: 21 Nov 2015
Total Posts: 146
25 Mar 2017 10:51 PM
script.Parent.ClickDetector.MouseClick:connect(function()
-- add rest of the script here
end

or replace MouseClick with MouseButton1Click:connect(onClicked)

If it's not a GUI and make sure you inserted the ClickDetector

or do Instance.new() -- you should know the rest.
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 11:10 PM
stops at "is test"


whats gonna work, teamwork!
Report Abuse
ninjaguy77777 is not online. ninjaguy77777
Joined: 15 Oct 2011
Total Posts: 2382
25 Mar 2017 11:11 PM
fixed it


whats gonna work, teamwork!
Report Abuse
OneThreeThreeEight is not online. OneThreeThreeEight
Joined: 08 May 2015
Total Posts: 129
26 Mar 2017 12:26 AM
if script.Parent.IsUsed == false then

If that's a BoolValue you're indexing, you need to say IsUsed.Value == false then.


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