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

How to successfully script a trapping 'death plate'?

Asked by 8 years ago
while true do

    wait(4)
    script.Parent.BrickColor=BrickColor:("Bright red") 
    wait(0.1)
    script.Parent:CanCollide = false
    wait(4)
    script.Parent.BrickColor=BrickColor:("Lime green")
    wait(0.1)
    script.Parent:CanCollide = true
    wait(0.1)

end


What I'm trying to do is to change the colour of the script's parent ( a brick ) and also to make it uncancollided and then reversed in a continuous loop. I don't see why it wouldn't work, so anybody could give me some help on that?

Current output: 18:14:29.211 - Workspace.DisappearingBrick.Script:4: '<name>' expected near '('

0
^ color* QuantumToast 261 — 8y
1
^ He might not be American Uroxus 350 — 8y
0
I'm British geeza KingCamembert 57 — 8y

2 answers

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

You don't understand what : is used for.


object:action() means to do some action to object.

If you don't have an action, or you don't have an object, you don't use :, you use .


Properties which you set with = will never use :, only . -- these are not doing actions, it's just some plain ol' property of the object.

BrickColor is not an object. It just holds onto a new constructor that you can get with . as in BrickColor.new("Bright red")

0
Thank you. Yes, I don't know why I put :, I think I got mixed up as I'm used to do another type of scripts, if you see what I mean. Thanks, though :) KingCamembert 57 — 8y
Ad
Log in to vote
1
Answered by 8 years ago

use script.Parent.BrickColor = BrickColor.new("Bright red")

Answer this question