i made an touch function and that function will increase my intvalue and teleport player But intvalue is not increasing.
i am confused that what to do.
on 10 line (game.workspace.PL.Value) underlined with red color
it says This:
Error:(10,27)Expected identifier when parsing expression,got'+'
Script:
function onTouch(part) if part.Parent.Humanoid ~=nil then part.Parent:MoveTo(script.Parent.Parent.Part1.Position) script.Parent.Parent.Part1.Script.Disabled = true wait(2) script.Parent.Parent.Part1.Script.Disabled = false end end script.Parent.Touched:connect(onTouch) game.workspace.PL.Value + 1
I see the error straight away. Just do this:
--Replace line 10 with this code below game.Workspace.PL.Value = game.Workspace.PL.Value + 1
*(Note: Do not use game.workspace
as it is deprecated. Use either workspace
or game.Workspace
.) *