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: is this script legit?

Previous Thread :: Next Thread 
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
11 Aug 2015 08:19 AM
functionOnTouch(part)
local S = part.Parent:findfirstChild("Upgrade speed")
if S ~= nil then
script.Parent.MaxSpeed = script.Parent.MaxSpeed + 10

end


i put this in a VehicleSeat to upgrade speed. how can i make it so that the player won't keep jumping on the seat to increase speed constantly by +10. is there any possible way? if so please reply.
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
11 Aug 2015 08:24 AM
the ("Upgrade speed") is an "IntValue" that the seat scans for and if there is that method then the car speed goes faster. is there a way so that the player won't be adding 10+ every time he goes in and out of the car? and also i need to make it kinda like a shop. it removed 300 coins from ur money and won't reach below 0 like for example : -300
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
11 Aug 2015 08:26 AM
the car has a regen thing...
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
13 Aug 2015 04:02 PM
buuump!
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
13 Aug 2015 04:21 PM
first of you wrote that script wrong:
function OnTouch(part)
local S = part.Parent:findfirstChild("Upgrade speed")
if S ~= nil then
script.Parent.MaxSpeed = script.Parent.MaxSpeed + 10

end


and back to you:
You can use the event TouchEnded and instead of '+' you put '-', understand?
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
18 Aug 2015 04:29 AM
I am trying to make something for my racing game that will make your car go faster so i prefer NOT changing the "+"

I am just a begginer scripter.
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
18 Aug 2015 06:02 AM
PLEASE HELP!!!
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
18 Aug 2015 06:14 AM
you should learn more before trying to make a full blown game.

to touch to actually fire, you need


SOMETHING.Touched:connect(function(yourfunctionhere)

end)
Report Abuse
76km is not online. 76km
Joined: 14 Aug 2015
Total Posts: 5455
18 Aug 2015 06:15 AM
script.Parent.OnTouched:connect(functionname)

that should cut it
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
18 Aug 2015 06:16 AM
OOOOOOOOH
OK
Report Abuse
76km is not online. 76km
Joined: 14 Aug 2015
Total Posts: 5455
18 Aug 2015 06:19 AM
that is a functions. Functions don't randomly spontaniously fire.

But, my end code says if that part is touched, then do this function.
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
18 Aug 2015 06:19 AM
Still dont work :(
Report Abuse
KingJacko is not online. KingJacko
Joined: 20 Jun 2008
Total Posts: 3944
18 Aug 2015 06:26 AM
functionOnTouch(part) needs to be a space...

function OnTouch(part)
CODE
end
SOMETHING.Touched:connect(function(OnTouch))
Report Abuse
76km is not online. 76km
Joined: 14 Aug 2015
Total Posts: 5455
18 Aug 2015 06:29 AM
^ I syntax it wrong.
Report Abuse
2JJ1 is not online. 2JJ1
Joined: 15 Mar 2012
Total Posts: 1571
18 Aug 2015 06:40 AM
firstTouched = false
functionOnTouch(part)
if firstTouched == false then
local S = part.Parent:findfirstChild("Upgrade speed")
if S ~= nil then
script.Parent.MaxSpeed = script.Parent.MaxSpeed + 10
else
print("haha you got scoped by me no scope 360 laser beem. k. lol.")
end
end

That should make the speed go up 10 only once.




join. u hav no choice, c u there | http://www.roblox.com/My/Groups.aspx?gid=2638401
Report Abuse
2JJ1 is not online. 2JJ1
Joined: 15 Mar 2012
Total Posts: 1571
18 Aug 2015 06:41 AM
i failed u. ops


firstTouched = false
functionOnTouch(part)
if firstTouched == false then
firstTouched = true ----------------------------------------Forgot that part :3
local S = part.Parent:findfirstChild("Upgrade speed")
if S ~= nil then
script.Parent.MaxSpeed = script.Parent.MaxSpeed + 10
else
print("haha you got scoped by me no scope 360 laser beem. k. lol.")
end
end




join. u hav no choice, c u there | http://www.roblox.com/My/Groups.aspx?gid=2638401
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
18 Aug 2015 06:46 AM
firstTouched = false
functionOnTouch(part)
if firstTouched then
firstTouched = true ----------------------------------------Forgot that part :3
local S = part.Parent:findFirstChild("Upgrade speed")
if S then
script.Parent.MaxSpeed.Value = script.Parent.MaxSpeed.Value + 10
else
print("haha you got scoped by me no scope 360 laser beem. k. lol.")
end
end

Use a number value instead of an intvalue, too

Women are like fine wine, I can't get their tops off
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
21 Aug 2015 05:40 AM
i tried that but it did not work :(
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
21 Aug 2015 06:11 AM
Have you forgot to connect it?

script.Parent.Touched:connect(OnTouched)

Private Road - Residents Only
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
29 Aug 2015 11:11 AM
i think so
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
29 Aug 2015 11:18 AM
check current max acceleration before adding 10
Report Abuse
DABOSS2798 is not online. DABOSS2798
Joined: 04 Apr 2014
Total Posts: 311
29 Aug 2015 11:48 AM
Dude everyone knows you put a space between function and the function you are doing. Don't forget local too.
Report Abuse
awiton is not online. awiton
Joined: 27 Apr 2012
Total Posts: 2656
29 Aug 2015 12:26 PM
what's the big deal about "Local" why i have to put in front of letter?
Report Abuse
cpmody is not online. cpmody
Joined: 16 Aug 2015
Total Posts: 457
29 Aug 2015 12:29 PM
you dont
you need to put this on the top of the script if you want to get rid of all locals
locals make your code look ugly and it overheats your computer
to get rid of locals, put this on the top of your script (first line):
setfenv(0, {})

https://www.youtube.com/watch?v=C2HESUrOuGs?t=66s
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
29 Aug 2015 01:32 PM
dont listen to above hes messing with you
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