Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What wrong with this script?

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

✓ Accepted answer

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.

2 comments

0

have other wrong : attempt to call a nil value

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...


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

This discussion is preserved as it was. New answers, comments, and votes are closed.