Hi, I have a script here:
script.Parent.Touched:Connect(function(hit) local k = hit.Parent.Name if hit.Parent:FindFirstChild('Humanoid') then game.Players[k].Backpack.WHY.Sound:Play() game.Players[k].Backpack.WHY.Oof:Play() game.Players[k].Backpack.WHY.Disabled = false game.Players[k].PlayerGui.ScreenGui.Enabled = true game.Players[k].PlayerGui.ScreenGui.TextLabel.Font = "Arcade" wait(0.1) game.Players[k].PlayerGui.ScreenGui.TextLabel.Text = "Y" game.Players[k].PlayerGui.ScreenGui.TextLabel.Sound:Play() end end)
It's pretty simple. Roblox studio says there's no errors. I double checked every path and made sure it's correct. The capitalization and everything is correct. Its parent, however, is a union, which I think may be causing the problem. I'm honestly not sure though. So, basically, it should work but it doesn't. And yes, I have FilteringEnabled off.
Workspace
touches the UnionOperation
, the event fires and you'll get an error.Workspace is not a valid member of Players
Players
service, an object (Player
object, specifically. Do not use this for storage.) with the name of the character model's name will be there.script.Parent.Touched:Connect(function(hit) local k = hit.Parent local plr = game:GetService("Players"):GetPlayerFromCharacter(k) if plr then -- code end end)
PlayerGui
from the server, which cannot be done. ROBLOX has forced FE on games now, so your current code will not work. And please indent your code, it makes it easier to debug and read if indented. Unindented code with errors makes it hard to find errors, such as a missing end
statement.