So When I step on the part it does print yes and yet it doesn't change the transparency?
local function onTouch(hit) game.StarterGui.ScreenGui.ScrollingFrame.BackgroundTransparency = 1 print("yes") end script.Parent.Touched:connect(onTouch)
GuiObject
on the server. You don’t use StarterGui
, you use PlayerGui
. You can’t modify PlayerGui
from the server either. Use a RemoteEvent
to do this.-- LocalScript under StarterGui/PlayerGui local remote = game.Workspace.RemoteEvent -- I recommend under ReplicatedStorage, but this is an example remote.OnClientEvent:Connect(function() -- :Connect not :connect, :connect is deprecated script.Parent.ScreenGui.ScrollingFrame.BackgroundTransparency = 1 end)
function onTouch(part) local plr = game:GetService("Players"):GetPlayerFromCharacter(part.Parent) if plr then game.Workspace.RemoteEvent:FireClient(plr) end end script.Parent.Touched:Connect(onTouch) -- Again, :Connect, not :connect