But, it def aight, Roblox’s fault.
It’s been already tested, I’ve done over 2 hours of wasting my time on making millions of checks and debugging and I ended up with the source of the problem to be .Triggered, since script runs only once and I am 200% sure. Only contents of .Triggered function are run twice.
I’m thinking my first answer is wrong, but you are definitely printing 2 things in this Print statement.
print(script:GetFullName(), script)
I am not sure what you mean, print function is called once but yet .Triggered runs twice causing it to be printed twice.
I’ve tried to narrow down the one thing that’s causing it but I couldn’t. I have only gotten it to work in your specific situation. I would report this as a bug.
Edit: I looked more and it seems to be something with collection service.
I did report it as a bug, now I am just waiting for the response.
No. I’m going back to my first answer. This should work for you:
ocal Prompt = Instance.new(“ProximityPrompt”)
Prompt.ActionText = “Open”
Prompt.ObjectText = “Door”
Prompt.RequiresLineOfSight = false
Prompt.Triggered:Connect(function()
end)
Prompt.Parent = Handle
print(script:GetFullName(), script)
Thanks actually.
You got me coding again for the first time in a year…
And erase, “Something’s wrong with, Roblox”, from your mind.
It is always going to be a logic error
I don’t always blame Roblox, but I had tried everything what I was capable of, and other person tried it as well and we ended up on the same conclusion so far. And only best people to investigate such problem would be the Roblox engineers themselves.
I’ve been going back and fourth and I guess there’s a chance this is some form of logic error. But, this really doesn’t seem like expected behavior. I think I’m going to end it here and we’ll just have to see what happens.
Huh?
It’s fixed.
You were printing it twice…
This is the code in the repro file, it’s calling print once:
local prompt = Instance.new("ProximityPrompt")
prompt.Triggered:Connect(function()
print("duplicate") -- Only printing text
end)
prompt.Parent = script.Parent
return {}
That one Print line is processed twice:
Now I understand where you’re coming from. When you define a function in Luau the code isn’t ran till it’s called. Even if that wasn’t the case, and print was running when you defined the function it wouldn’t be called twice on every event.
You know that OOP exists right? You should be using it instead of what your doing in you code.