hello, i’m making a script for VRP for write notes
i have make this for now in vrp/cfg/item/required.lua
items["frighev"] = {"Foglio A Righe Vuoto","Qui Puoi Scrivere Quello Che Vuoi!!",function(args)
local choices = {}
local idname = args[1]
choices["Scrivi"] = {function(player,choice,mod)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
--play_scrivi()
vRP.prompt(player, "Cosa Vuoi Scrivere ? ", "", function(player,rtext)
if vRP.tryGetInventoryItem(user_id, "pennab", 1, true) then
if vRP.tryGetInventoryItem(user_id, idname, 1, true) then
vRP.giveInventoryItem(user_id, "frighe", 1, true)
--vRPclient.stopAnim(player,{true}) -- upper
--vRPclient.stopAnim(player,{false}) -- full
vRP.closeMenu(player)
end
else
vRPclient.notify(player,{"~r~Non Hai La Penna!!!"})
end
end)
end
end}
return choices
end,0}
items["frighe"] = {"Foglie A Righe","Un Foglio In Cui C'è Scritto Qualcosa", function(args)
local choices = {}
local idname = args[1]
choices["Leggi"] = {function(player,choice,mod)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
--play_scrivi()
vRP.prompt(player, "Messaggio: ", rtext, function(player)
end)
end
end}
return choices
end,0}
but on the prompt “Messaggio” he return me “nil”
can you help me please?
This is Client side and I know I need to write something on the server side, but I don’t know what
I’m trying to do this script from 5 houres,
thank for any help
rtext non è definito da nessuna parte e quindi penso che sia per quello che ha valore nil.
Scrivo la risposta anche in inglese cosi’ che tutti possano leggerla
Hello, i dont know how vRP works but in this function call
sisi certo che ricordo mmm potresti provare a fare una cosa del genere:
local testo = nil
items["frighev"] = {"Foglio A Righe Vuoto","Qui Puoi Scrivere Quello Che Vuoi!!",function(args)
local choices = {}
local idname = args[1]
choices["Scrivi"] = {function(player,choice,mod)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
--play_scrivi()
vRP.prompt(player, "Cosa Vuoi Scrivere ? ", "", function(player,rtext)
if vRP.tryGetInventoryItem(user_id, "pennab", 1, true) then
if vRP.tryGetInventoryItem(user_id, idname, 1, true) then
testo = rtext
vRP.giveInventoryItem(user_id, "frighe", 1, true)
--vRPclient.stopAnim(player,{true}) -- upper
--vRPclient.stopAnim(player,{false}) -- full
vRP.closeMenu(player)
end
else
vRPclient.notify(player,{"~r~Non Hai La Penna!!!"})
end
end)
end
end}
return choices
end,0}
items["frighe"] = {"Foglie A Righe","Un Foglio In Cui C'è Scritto Qualcosa", function(args)
local choices = {}
local idname = args[1]
choices["Leggi"] = {function(player,choice,mod)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
--play_scrivi()
vRP.prompt(player, "Messaggio: ", testo, function(player)
end)
end
end}
return choices
end,0}
pero’ non ho veramente idea se questa cosa possa funzionare o no
Grazie Mille Tonish, Mi Hai Aiutato Per La Seconda Volta, Ora Però Tocca Vedere Se Quando Do Il Foglio A Un’Altro player, quel player è in grado di vedere il messaggio