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

What wrong with this script?

Asked by 10 years ago
function onTounched(playerWhoTounched)
    game.workspace.PIDS.PIDS.PIDS.Frame.TextLabel.A.Value = false and 
    game.workspace.PIDS.PIDS.PIDS.Frame.TextLabel.B.Value = true     
     end
    end
script.Parent.Touched:connect(onTouched)

Wrong: - Workspace.PIDS.Part.Script:3: unexpected symbol near '=' - Attempt to connect failed: Passed value is not a function

l need a fix script(less worlds)

2 answers

Log in to vote
1
Answered by
Necrorave 560 Moderation Voter
10 years ago

It looks like you have things that do not belong inside your script

function onTouched(playerWhoTounched) --You spelled "Touched" wrong
    game.workspace.PIDS.PIDS.PIDS.Frame.TextLabel.A.Value = false -- I took out "and"
    game.workspace.PIDS.PIDS.PIDS.Frame.TextLabel.B.Value = true     
     end
-- You had an extra "end" here.  I took that out as well.
script.Parent.Touched:connect(onTouched)

See if that helps, if it does not. Than we may need to look further into this.

You named the function "onTounched" at first, I changed it to "onTouched" for you here.

I removed the "and" in the beginning because it was not needed and use incorrectly. In your script, it will go in order from top to bottom. So the "and" in that case was not needed.

0
have other wrong : attempt to call a nil value 7785543 2 — 10y
0
I checked again. I edited another error. You mispelled the name of your function. I changed it to "onTouched" for you rather than "onTounched". See if that helps... Necrorave 560 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

function onTouched(playerWhoTounched) --Function was misspelled game.workspace.PIDS.PIDS.PIDS.Frame.TextLabel.A.Value = false and game.workspace.PIDS.PIDS.PIDS.Frame.TextLabel.B.Value = true end end script.Parent.Touched:connect(onTouched)

You can keep track of me on ROBLOX Xbox Live My name is ColinSantos8 Club Penguin My name is ColinSantos8 Thanks

Answer this question