I have a good understanding of events and how they work, yet I have no idea how to make them change the properties of objects. By objects, I mean I need to know how to change both the properties of an object that I stepped on and the properties of an object completely separated from the one I just stepped on.
If you want to change to properties of parts when touched I recommend using this:
01 | local object = game.Workspace.Object |
02 | local touchedPart = script.Parent |
03 |
04 | touchedPart.Touched:Connect( function (hit) |
05 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
06 | touchedPart.BrickColor = BrickColor.new( "Really blue" ) -- change brickcolor |
07 | object.Position = Vector 3. new( 5 , 5 , 5 ) -- change poistion |
08 | object.Size = Vector 3. new( 10 , 10 , 10 ) -- change size |
09 | end |
10 | end ) |
This script is located inside touchedPart