I want a script where a player touches a brick, and then a gui pops up
Here's a script
-- script script.Parent.Touched:Connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) game.ReplicatedStorage.MMEvent:FireClient(player) end)
-- local script game.ReplicatedStorage.MMEvent.OnClientEvent:Connect(function(player) local frame = script.Parent.Parent Frame.Visible = true end)
for some reason the output says "player argument must be a Player object"
You need check if who touched is a player
(in my opinion, the best way would be:)
-- script script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then -- check if who touched "have" humanoid local player = game.Players:GetPlayerFromCharacter(hit.Parent) game.ReplicatedStorage.MMEvent:FireClient(player) end end)