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.
✓ ANSWER ACCEPTED
How do I change properties via events?
1 answer
✓ Accepted answer
If you want to change to properties of parts when touched I recommend using this:
local object = game.Workspace.Object
local touchedPart = script.Parent
touchedPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
touchedPart.BrickColor = BrickColor.new("Really blue") -- change brickcolor
object.Position = Vector3.new(5,5,5) -- change poistion
object.Size = Vector3.new(10,10,10) -- change size
end
end)
This script is located inside touchedPart
This discussion is preserved as it was. New answers, comments, and votes are closed.
