script.Parent.Touched:connect(function(plr)
    local UIS = game:GetService("UserInputService")
    UIS.InputBegan:connect(function(input)
        if input.KeyCode == Enum.KeyCode.G then
            script.Parent.Parent.Parent:Destroy()
        end
    end)
end)

My problem is that the script will work successfully in ROBLOX Studio, but in a ROBLOX Server it will not work.

This is a Regular Script, It's parent is a brick inside a torso of a clone of a player's character

So I want it so when they touch the brick inside the torso it lets them press G to destroy the Character.

In my last post, someone pointed out that I should use a Remote Event and that I should change it to a local script but i feel like that didn't work.

2 comments

0

Like said before, you can't get user input in a server script. Request this from a Remote Event. Please don't duplicate your questions.

0

As cabbler said, don't use a normal script. Also, if u are putting this in PLAYERS and not humanoids... when someone touches your brick, if you click G, you die.