I need help working on a script where there is an npc who wants 3 items, right now a billboard in the npc says 0/3 and when you give the 3 tools to him it has to be in order from “Engine” “Battery” “Tire” and then he gives you a random tool. I am lost and dont know where to start. every tool you give him should make the billboard text go up +1/3 I will pay 350 robux to a user who can fix this, (no tax).
You should post this on the Talent Hub instead of here.
edit nvm again it isn’t a bug so I just brought the post back
im not trying to hire anyone, i just want to pay someone who can help me fix the issue im having, the scripts are in the testing server i gave.
Hello i have done the the script, do you still need it?
yes i do are you able to send the test place over?
Sure! I can make something like this easily!
Do you want the quest thing clientsided or server-sided?
In break in, as long as I remember it is clientsided until someone completes the quest
yeah that is exactly what im looking for it should be client side until the quest gets complete. this is the updated dev forum post with the main components to the script
The code is already client-sided and you can fire an remote event when the task completes
im not looking for it to be fully client sided and the one you made you need the 3 tools in your inventory and you have to click the npc. it should be you equip the tool and click the npc to give the npc one of the tools.
im not looking for it to be fully client sided
Not sure what you mean but that script is client sided and after the player finishes the task you can fire a remote event to the server to do what you want
it should be you equip the tool and click the npc to give the npc one of the tools.
that can be easily done:
local function CheckItems()
for i,v in ipairs(objstate) do
--print("v = ", v)
if v == false then
--print("i = ", i)
local Value = player.Character:FindFirstChild(Objects[i])
if Value and i == #objstate then
--Player collected all the items
objstate[i] = true
billboard.TextLabel.Text = tostring(i).." / 3"
elseif Value then
--Player collected an item but not all
objstate[i] = true
billboard.TextLabel.Text = tostring(i).." / 3"
else
--Player don't have the item
end
return;
end
end
end
Sooo, i have done it where is the payment?
its not even done right, i dont want it coming from the client side.
its not even done right, i dont want it coming from the client side.
doing that on the server is inefficent and harder you have to do it on the client. though if you want to tell the server that player X has done the task, you basically add a RemoteEvent in the ReplicatedStorage and then fire it.
yeah but you are looking for payment but the way i want it is when the players join they can all help with the one quest which is server sided and the tool even should be client sided where it interacts with the model from the client side.
If you want the serverside then create a script in the ServerScriptServer then add this:
--local player = game:GetService("Players").LocalPlayer --The Player
local billboard = workspace:WaitForChild("NPC"):WaitForChild("BIllboard"):FindFirstChild("BillboardGui") --The Billboard
local clickDetector = workspace:WaitForChild("NPC"):WaitForChild("ClickDetector") --The ClickDetector
local objstate = { -- The state of the object
false,
false,
false,
}
local Objects = { -- The objects
"Engine",
"Battery",
"Tire",
}
local function CheckItems(player :Player)
for i,v in ipairs(objstate) do
if v == false then
--local Value = player.Backpack:FindFirstChild(Objects[i]) or player:FindFirstChild(Objects[i])
local Value = player.Character:FindFirstChild(Objects[i])
if Value and i == #objstate then
--Player collected all the items
objstate[i] = true
billboard.TextLabel.Text = tostring(i).." / 3"
elseif Value then
--Player collected an item but not all
objstate[i] = true
billboard.TextLabel.Text = tostring(i).." / 3"
else
--Player don't have the item
end
return;
end
end
end
clickDetector.MouseClick:Connect(function (playerWhoClicked)
CheckItems(playerWhoClicked)
end)
it didnt even work. go onto the test server and try it for urself.
i tried it before giving it you and it’s working the reason it isn’t working for you i believe that the player has the tool locally and that’s why i suggested using client-sided