✓ Accepted answer
The errors were pretty simple. You made a few mistakes.
##Mistakes:
- You didn't use vector3 (Used for the positioning and sizing of an object)
- You added an end with a parenthesis (An end with parenthesis should only be used with the :Connect function)
- You cannot assign a name with a function such as BrickColor
##Fixed Script
if script.Parent:GetTouchingParts(HumanoidRootPart) then
script.Parent.CanCollide = false
script.Parent.BrickColor = BrickColor.new("Really red")
game.Workspace.ty1ba.Size = Vector3.new(420.69, 0.8 , 420.69)
end
If you want it so that it gets it when they touch it, you can simply do this:
####Touched event
script.Parent.Touched:Connect(function(hit)
if script.Parent:GetTouchingParts(hit.Parent.HumanoidRootPart) then
script.Parent.CanCollide = false
script.Parent.BrickColor = BrickColor.new("Really red")
game.Workspace.ty1ba.Size = Vector3.new(420.69, 0.8 , 420.69)
end
end)
If this answer fails to work, please comment so I can amend it!
Refined grammatical errors. Date: February 19, 2021
4 comments
Instead of saying GetTouchingParts, why don't you simply make a touched event instead?
And is the cancollide turning to false? What about the brickcolor?
that error is because you are not supposed to have a closing parenthesis on the end, since there is nothing for it to close
Once again, these errors are simple and easy to debug.