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 » Scripting Helpers
Home Search
 

Re: How do I add .1 to a size of a brick every time i touch it?

Previous Thread :: Next Thread 
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 09:51 PM
D: i had this in my head i just go about with it, any help?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 09:53 PM
Workspace.yourname.Torso.Touched:connect(function(h)
h.Size = h.Size + Vector3.new(0.1,0.1,0.1)
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 09:57 PM
Or specific to a part:
P = Workspace.partname
P.Touched:connect(function()
cf = P.CFrame--keep it in place..
P.Size = P.Size+Vector3.new(0.1,0.1,0.1)
P.CFrame = cf
end)
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 09:57 PM
this is what im making, whenever a snowball touches the floor, the size of the base2 increases by 0.1 but i get this wierd error

function onTouched(hit)
if hit.Name == "Snowball" then
hit:Destroy()
Workspace.Base2.Size = Workspace.Base2 + Vector3.new(.1,.1,.1)
end
end

script.Parent.Touched:connect(onTouched)

"22:57:03.949 - Workspace.Base.Script:4: attempt to call global 'Vector3' (a table value)
"
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:00 PM
22:56:46.260 - Workspace.Base.Script:4: bad argument #1 to '?' (Vector3 expected, got userdata)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 10:01 PM
Workspace.Base2.Size = Workspace.Base2 + Vector3.new..hold on,take a look back there
--ur missing something..
Workspace.Base2.Size = Workspace.Base2.(what's missing here?) + Vector3.new etc..
U forgot ".Size"
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 10:02 PM
db = true
script.Parent:connect(function(hit)
if db == false then db = true end
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
script.Parent.Size = script.Parent.Size + Vector3.new(.1,.1,.1)
end end)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 10:02 PM
^Put that into the brick.
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:02 PM
okay so now thats working, what about the brick?

it just spaces out wierdly. do i have to set my cframe position to the same as base?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 10:02 PM
Did u see his post?a snowball has no humanoid in it..
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 10:04 PM
And. Yeah u do,didn't u see this?:

"Or specific to a part: P = Workspace.partname P.Touched:connect(function() cf = P.CFrame--keep it in place.. P.Size = P.Size+Vector3.new(0.1,0.1,0.1) P.CFrame = cf
end)
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:08 PM
this is what i got..

but it only expands one and it doesnt expand ever again

function onTouched(hit)
if hit.Name == "Snowball" then
hit:Destroy()
Workspace.Base2.Size = Workspace.Base2.Size + Vector3.new(0,.1,0)
Workspace.Base2.CFrame = Workspace.Base.CFrame
Workspace.Base2.BrickColor = BrickColor.new("White")
Workspace.Base2.CanCollide = false
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 10:10 PM
Ohh.. it's a snowball..? So I'm guessing it has a Mesh in it.

db = true
script.Parent:connect(function(hit)
if db == false then db = true end
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
script.Parent.Mesh.Scale = script.Parent.Mesh.Scale + Vector3.new(.1,.1,.1)
end end)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 10:11 PM
Ugh.. nvm lol I thought you meant the thing that was supposed to grow is a snowball..
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 10:11 PM
Y u set cancollide to false?
Also
cf = partname.CFrame--saves the spot it was at
--resizes it..p.s when size is changed,it'll go above anything,that's why we save the cframe
partname.CFrame = cf
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:13 PM
i made it cancollide false because you dont walk on top of snow unless you actually have ice. anyways, for some reason it only works with big values like 0.3 + but not 0.2

its not working ;/.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 10:14 PM
db = true
local b = game.Workspace.Base2
script.Parent.Touched:connect(function(hit)
if db == false then db = true end
if hit.Parent:FindFirstChild("Snowball") ~= nil then
b.Size = b.Size + Vector3.new(0,.1,0)
b.CFrame = Workspace.Base.CFrame
b.BrickColor = BrickColor.new("Institutional white")
b.CanCollide = false
end end)
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
14 Feb 2014 10:17 PM
hi u
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:18 PM
@goul

it worked, but didnt solve my issue.

it freezes at .4 and then wont grow anymore :/.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 10:19 PM
Those moments when you wish cntkillme was on..
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:20 PM
i know cntkillme is too good
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
14 Feb 2014 10:21 PM
tl:dr for me den I will help pls
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:22 PM
hey iam
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 Feb 2014 10:23 PM
ok,so "base2" is snow?
Remove. Base 2 for now
Copy base
Color it
Set its cancollide to false
Put this script in it

script.Parent.Touched:connect(function(thing)
if thing.Name == "SnowBall" then --or whatever its named
Cf = script.Parent.CFrame
script.Parent.Size = script.Parent.Size + Vector3.new(0,0.1,0)
script.Parent.CFrame = Cf
end
end)

So now what u should have is

Workspace
-Baseplate(or base)
-Base2
--Script
Report Abuse
yurhomi10 is not online. yurhomi10
Joined: 10 Dec 2008
Total Posts: 13886
14 Feb 2014 10:33 PM
your confusing me o.e
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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