hello, I made a script when you touch the desk, it gives you statistics, but I have 2 problems 1 of them I want to make sure that when the player stood on the desk, he was given strength and not always ran to the desk and got off it and 2 problem I would like to make it so that when the player stood on the desk, he did not I was able to use the endurance tool well, as I could not, I would like that when a player uses his tool, he was not given a boost, otherwise consider he will get x2 strength I will be grateful to everyone for help here is the script itself
script.Parent.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
if delay == false then
player.Endurance.Value += 1e90
delay = true
wait(1)
delay = false
elseif delay == true then
end
end
end)
It’s really hard for me to understand what you are trying to say.
Could you write the problems in a simple term and use bulleted list? I’ll still try to understand the problem better. Ill update this when I do find a possible solution.
Problem 1
Try using variables to determine who touched the part and who ended the touch. Create a table of the players in the zone using this.Using this you can probably use a loop to give all those players the required stats.
There are more ways but for now I’ll stick with this. But you can also try region3
Sorry for the translator 1.I want when the player stood on the part, he got a boost, and not went down and got on it 2. I want when a player uses their tool, the item they couldn’t get a boost from it
Don’t worry about it. Here is what I understood tho the subjects still aren’t clear:
When a player stands on “the” part, he gets a certain boost and not when gets out and gets back on it.
When a player uses their tool (assuming he is standing on that same part) he wouldn’t get that boost.
Is this what you are trying to say? Or is it something else?
Some other questions
Is it like, you touch a part to get the boost and it’s not like if you are standing on it you can’t get it repeatedly or is it like you have to stand on the part to continuously get that boost repeatedly. Like how a sell circle works in certain games?
Do you have a variable inside the player that defines if the player has / using the boost?
Cause I think u mean at the first problem that he can’t get another boost if he already has one. Or if one is already active.
Or is it like these specific parts give one boost for everyone if they touch it. And they can get it back every 1 hour or something?
Yea I know that, Although I don’t understand the problem here. I’ll try to write some codes according to the problem you’ve mentioned. I’ll write 2 different codes and send it to you when I can. And see if that’s what you are looking for.
So what you are telling me is that is you have a weapon on you, you can’t pick up the endurance boost cause it’s a melee type? But the melee type is also a weapon (tool)
I think I understand what you are trying to say. Ill reply you in 3 hours probably. But the code I will provide may not be what you are looking for I think if so I am sorry but I’ll try my best.