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

A part i made supposed to be colllided, can you help me fix it?

Asked by
656339 -3
7 years ago

So, I'm new to scripting, and I did a script, but it didn't work. Can you guys help me?

function onTouched()
    script.Workspace.MessageBlock1.MessageScript.CanCollide = false
     wait(14)
    script.Workspace.MessageBlock1.MessageScript.CanCollide = true  
end

Thats the code. plus my goal was making MessageBlock1 to block the player from bypassing it, but when you wait 14 seconds, it is now bypassable.

0
Hi.. :D To start off in order for us to help you we're going to need more information on your actual script. What you gave us is referred to as a function, and only a segment of what makes up an actual script. All we see here is a bunch of lines of code that we personally do not know what they do so we can't help you debug this. A few things you can provide us are: The rest of the script so we can F_lipe 135 — 7y
1
Is `MessageScript` a Script? If it is.. scripts don't have a `CanCollide` property. Also there is no connection statement in your code. And as for it becoming bypassable again.. lines 3 and 4 are the cause.. Goulstem 8144 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Well first things first script.Workspace is not a thing. I think what you are looking for is game.Workspace. Also you need to connect the function to the part. Finally scripts do not have a CanCollide property. The following should work assuming MessageBlock1 is the actual part:

game.Workspace.MessageBlock1.Touched:connect(function()
    game.Workspace.MessageBlock1.CanCollide = false
        wait(14)
    game.Workspace.MessageBlock1.CanCollide = true 
end)
0
Thank you very much wesleyd1124! Im pretty new to scripting! 656339 -3 — 7y
Ad

Answer this question