Hello. I have TextButtons on these parts that when clicked are supposed to fire the server for an event. They are not doing this. The buttons aren’t even being registered as being clicked.
The buttons very clearly do their little color change effect when I click them, so I know that I’m clicking them, but button.Activated never runs.
Code:
local players = game:GetService("Players")
local events = game.ReplicatedStorage.Events
local model = script.Parent.Parent.Parent.Parent
local player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
print("oh")
local itemName = model.Name
events.PressedWeapon:FireServer(itemName)
end)
The playerScript idea does work, and I may resort to that + collection service, but it isn’t tackling the heart of the issue as to why surface buttons are not detecting in their own scripts. Do local scripts not run in workspace parts?
Ah true, it isn’t used anyways so I will delete it.
You cannot put textbuttons on workspace surface guis, as it is not in startergui so there would be no way to click it.
Just put the surface gui in startergui and set the adornee to part, so that you can click it.