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: How to make a click detector change an int value?

Previous Thread :: Next Thread 
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 02:03 PM
I have an int value of 10 and in another part i have both a click detector and a script.

in the script i have:

function onClicked(playerWhoClicked)
game.Workspace.IntValue.Value = 100
end
script.parent.ClickDetector.MouseClick:connect(onClicked)

This still doesnt change the value of the int value and i cant figure out why...







/End
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:11 PM
won't work from a local script under FE


121,270 slices of pizza and counting!
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
27 Mar 2017 02:11 PM
is it giving you any errors?

local SuperPart = Instance.new("Egg")
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:11 PM
o wait nvm the error is
script.parent

script.Parent

(don't call children parent if it's not a typo)


121,270 slices of pizza and counting!
Report Abuse
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 02:35 PM
No error messages but it still doesnt work


/End
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:36 PM
is parent a child or are you referencing the Parent of the script?


122,306 slices of pizza and counting!
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
27 Mar 2017 02:38 PM
Btw lua is cap sensitive so "Parent" needs to be capitalised.


Rap: 985 R$525
Report Abuse
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 02:43 PM
There is a part and inside the part there is both a click detector and a script


/End
Report Abuse
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 02:44 PM
btw i have fixed the capital P


/End
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:45 PM
function onClicked(playerWhoClicked)
game.Workspace.IntValue.Value = 100
end

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


122,070 slices of pizza and counting!
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:46 PM
Scraping the barrel here lol

function onClicked()
game.Workspace.IntValue.Value = 100
end
script.Parent:FindFirstChild("ClickDetector").MouseClick:Connect(onClicked)


122,070 slices of pizza and counting!
Report Abuse
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 02:48 PM
Still doesnt work, it doesnt give any error but it doesnt change the value


/End
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
27 Mar 2017 02:49 PM
Let me help you here.


Rap: 985 R$525
Report Abuse
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 02:52 PM
I just need the button when clicked to change an int value

(the int value isnt inside of the part that the script/click detector is. its just in the workspace)


/End
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:54 PM
Did you name the ClickDetector something other than ClickDetector?


122,503 slices of pizza and counting!
Report Abuse
MilesJDCRAFT is not online. MilesJDCRAFT
Joined: 10 Feb 2016
Total Posts: 432
27 Mar 2017 02:54 PM
#code I don't know.


This is a siggy that isnt a siggy.
Report Abuse
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 02:54 PM
No the click detector is still called: "ClickDetector"


/End
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:55 PM
Try throwing your computer out the window.


122,503 slices of pizza and counting!
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
27 Mar 2017 02:56 PM
script.Parent.ClickDetector.MouseClick:connect(function()
local Value1 = game.Workspace:FindFirstChild("IntValue")
Value1.Value = Value1.Value + 1






end)


Rap: #Rap #Robux
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 02:57 PM
Why do you keep changing the logic of people's scripts lol


122,549 slices of pizza and counting!
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
27 Mar 2017 03:00 PM
"Why do you keep changing the logic of people's scripts lol"
What do you mean by that.


Rap: 987 R$525
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 03:02 PM
Value1.Value = Value1.Value + 1 game.Workspace.IntValue.Value = ### ####### slices of pizza and counting!
Report Abuse
Atavis is not online. Atavis
Joined: 10 Apr 2012
Total Posts: 1463
27 Mar 2017 03:02 PM
urgh nvm


122,548 slices of pizza and counting!
Report Abuse
matthewbadyy is not online. matthewbadyy
Joined: 25 Apr 2011
Total Posts: 424
27 Mar 2017 03:03 PM
game.Players.PlayerAdded:connect(function(player)

player.CharacterAdded:connect(function(character)

wait(.1)

local hum = character:WaitForChild("Humanoid")

hum.WalkSpeed = game.Workspace.IntValue.Value

end)

end)


This is the other part of the code that is used, this is in a separate script in the workspace


/End
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
27 Mar 2017 03:06 PM
My script work's i tested it so.


Rap: 987 R$525
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