bro i want something like when a player has equipped the armor it like a item comes and plays animation and if player is holding for 15 seconds then make it unequipped and if player tries to equip it should send notifications saying you cant equip until 10 seconds and by 2 seconds the notification should go and if 10 seconds over then allow them to quip how do i do that?
You might want to watch some basic tutorials on scripting. Its ok that you don’t know anything we all start somewhere. But I’d rather you learn how to do it and ask for help than someone writing the script for you.
You need a tool setup and have a script in there. It would look something like this(this probably has a lot of errors and is not efficient please don’t copy this and just learn from it)
This is just unequipping it after 15 seconds
local tool = script.parent
local time = os.clock()
local humanoid = script.parent.parent.Humanoid
tool.Equipped:Connect(function()
time = os.clock()
if os.clock()-time == 15 then
Humanoid:UnequipTools()
end
end
Learning LUA is only difficult if you make it difficult. Personally I just sit down, watch scripting tutorials for fun and learn something I never knew existed or that I didn’t know before. It’s just a matter of understanding what the syntax is that proves to be difficult.
I can attempt to break down this guys code so it’s a bit easier to understand
local tool = script.parent -- This is referring to the actual tool that the player holds. You need this to connect it to a function later.
local time = os.clock() -- This variable is getting the time since called
local humanoid = script.parent.parent.Humanoid -- This is referring to the humanoid object of your players character. It holds your health, jump power, etc...
tool.Equipped:Connect(function() -- This function is making it so when you equip your tool, the tool will automatically fire the code below
time = os.clock() -- Getting the time since last called
if os.clock()-time == 15 then -- Checking to see if 15 seconds has past since os.clock() was called
Humanoid:UnequipTools() -- Makes the character forcefully unequip their tool if they currently have it equipped
end -- closes the if statement from 'if os.clock()-time == 15 then'
end -- Ends the script once completed.
I unfortunately don’t have much time to teach someone something, especially over online since I have commissions open and such, but I can help lead you in the right direction instead: I’d check out these YouTubers:
TheDevKing makes pretty straight forward tutorials. I learned how to completely work processReceipt from MarketPlaceService with this guy. He has a beginner scripting series along with an advanced scripting series. I’d binge both tbh, but work your way up ofc.
AlvinBlox is a pretty good YouTuber too. He goes a little too fast at times but that’s probably just me, I never really liked the way he taught the content however he does show how to make quick games and do specific things so I would definitely tell you to consider giving AlvinBlox a try as well if TheDevKing doesn’t work out for you.