VParker Posted February 19, 2017 Share Posted February 19, 2017 So my problem is that it shows this error: Script Error: try\try.lua:6: ')' expected near "tried" when i launch my try resource.. Can anybody help me what to do? Here's the script: function try(plr) local chance = math.random(0,1) if chance == 1 then local playerName = getPlayerName local actiontext = string.sub (text,3) outputChatBox ( " .. getPlayerName .. " "tried" " .. actionText .. " "and it worked!" , root, 0, 255, 0, true ) else local playerName = getPlayerName local actiontext = string.sub (text,3) outputChatBox ( " .. getPlayerName .. " "tried" " .. actionText .. " "and it didnt work!" , root, 255, 0, 0, true ) end end Link to comment
Bananovy Posted February 19, 2017 Share Posted February 19, 2017 (edited) function try(plr) local chance = math.random(0,1) if chance == 1 then local playerName = getPlayerName local actiontext = string.sub (text,3) outputChatBox ( getPlayerName .. "tried" .. actionText .. "and it worked!", root, 0, 255, 0, true ) else local playerName = getPlayerName local actiontext = string.sub (text,3) outputChatBox ( getPlayerName .. "tried" .. actionText .. "and it didnt work!", root, 255, 0, 0, true ) end end Btw. you will have to fix your playerName/getPlayerName. Edited February 19, 2017 by Bananovy Link to comment
Tails Posted February 19, 2017 Share Posted February 19, 2017 you can do outputChatBox ( getPlayerName(plr) .. "tried" .. actionText .. "and it didnt work!", root, 255, 0, 0, true ) -- or local name = getPlayerName(plr) outputChatBox ( name .. "tried" .. actionText .. "and it didnt work!", root, 255, 0, 0, true ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now