Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Not growing ontouched?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

When I touch the part, it does not grow in all axis's.

x = script.Parent
Touched = script.Parent.Touched:connect()

x.Touched.Size = x.Size + Vector3.new(1,1,1)



1 answer

Log in to vote
3
Answered by 8 years ago

**Fixed code : **

x = script.Parent -- Im guessing the parent of this script is a brick?
x.Touched:connect(function() -- You use a function to make it OnTouched for what you want.. Other then that the code should be fine.
    x.Size = x.Size + Vector3.new(1,1,1)
end)

**Desc of the code : **

local x = script.Parent -- This script should be parented on the brick.

x.Touched:connect(function() -- Heres what you where missing, it connects a new function.
    -- x.Size.Touched will NOT work because its... just it wont work. lol
    x.Size = x.Size + Vector3.new(1,1,1) -- x.Size = x.Size use's the same part's Size
    -- + Vector3.new() adds more to the current size.
end)
Ad

Answer this question