✓ Accepted answer
your entire script is wrong
if your game is not in experimental mode, then you need to use a RemoteEvent, that should be parented to game.ReplicatedStorage, but I assume you don't know how to do that so I comment every line in the following script with detailed explanations
Server Script (For creating the remote, and handling the Touched event)
The Server Script should be inside the Part.
local NewGui = Instance.new("RemoteEvent")
NewGui.Name = "NewGui"
NewGui.Parent = game.ReplicatedStorage
script.Parent.Touched:Connect(function(Hit)
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Player ~= nil then
NewGui:FireClient(Player)
end
end)
Local Script (For handling the Remote, and creating the Gui)
The Local Script should be inside StarterGui.
game.ReplicatedStorage:WaitForChild("NewGui").OnClientEvent:connect(function()
local ScreenGui = Instance.new("ScreenGui")
local TextLabel = Instance.new("TextLabel")
ScreenGui.Parent = script.Parent
TextLabel.Parent = ScreenGui
TextLabel.Text = "Welcome"
end)
1 comment
is it filtering ebnabled?