Click detector script error?

So I’ve got a BoolValue inside my player character.

If I try to change that value with a touched event server script it works, but if I do it with a Proximity-prompt it doesn’t seem to work?

1 Like

Please, provide your code when you are asking for help. Make your title and your description more elaborate, not just “it won’t work” statements (what else does your script have to do/what did you expect your script to do?)

Provide additional details if possible, such as output errors, videos, and screenshots. These are said by the default post template when writing a question under #help-and-feedback:scripting-support.

1 Like

What do you mean, I explained it? lol

I have a touched event server sided script that tries to change the value of a BoolValue parented inside my player character. And then I have another server script that runs on a proximityprompt event that does the exact same thing. But the value only changes on the touched event script.

isSafePart.Touched:Connect(function(part)
	if not part.Parent:FindFirstChild("Humanoid") then return end
	local character = part.Parent
	local isSafe = character.IsSafe
	isSafe.Value = false
end)

This works ^

This does not work:

isSafePart.Triggered:Connect(function(clicker)
local character = Clicker.Character
		character.IsSafe.Value = true
end)

We don’t see your environment and your code. Even if you have explained your issue to us, we can’t just simply guesstimate what your code looks like, and how it should perform. You must send us the problematic part of your code.

I edited my post to show the scripts, they are both server sided.

You misspelled the parameter “clicker”.

I was just manually writing it, assume it’s correct. I didn’t copy paste from studio. There is no output errors.

isSafePart does not have a “Triggered” signal. The error may have been logged early, in which other messages have flooded the output, and so it appeared it was not there.

I figured it out, turns out I had somehow duplicated the script and I was editing the wrong script to the wrong part.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.