Part Kills When Highlight is Changed by Keybind but Not Touch

  1. What do I want to achieve? Currently, I am attempting to create a game where you can change the color of your character’s highlight to colors of the rainbow with keybinds (currently set as Z, X, C, V, B, and N for testing) to live only on the colored parts that are the same as your highlight.

I have successfully created a script that changes your highlight when you touch one of the color pads and allows you to live on the color that your highlight is when touched.


  1. What is the issue? Although I have successfully allowed this idea to execute on touch, for whatever reason when I’m using keybinds, the same color as your highlight also kills you. When I change colors with keybinds, it doesn’t seem to ACTUALLY count as changing the color, because the color I was previously on with color from the pad I touched doesn’t kill me when I change to a color other than what it is. My highlight is in ReplicatedStorage.

Example of Keybind Killing but Touchpad Not:
https://streamable.com/dpdbq7

Example of Color Not Changing Back After I Configure it With a Keybind
https://streamable.com/kai13o

Keybind LocalScript inside of StarterGUI

Pad that Changes the Color of Your Highlight (In this image it’s yellow)

The Pad That Kills You if Your Highlight Isn’t the Same Color

There is Only One Highlight

  1. What solutions have I tried so far? I haven’t really messed too much with the scripts because I simply can’t figure out the reason for it not working with keybinds. The colors are the same, but still end up killing me.

And to summarize the entire issue in short:
The Keybind Changing the Color is being Entirely Ignored Despite Affecting the Same Highlight

1 Like

The reason this is happening is because your changing your player’s highlight locally in your local script with the keybinds, your going to need a remote event, something that allows you to communicate with the server telling it “I want to change my highlight color”, if you go into server view after changing the highlight color by keybind youll see it hasn’t changed from the previous one

Thank you! This makes sense.
Although, I don’t quite understand how to mess around with remote events because I have never messed with them before, but is there any tutorial or page you’d recommend for learning the basics of remote events?

1 Like

There isn’t learning the basics as Remote Events just allow communication between clients and the server, it’s that simple

Here’s a short and sweet video

Alright, this explains my question.
Thanks.

1 Like

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