im writing a lava brick script that hurts the player when they touch it but any brick names “lava” gets that attribute. For some reason i keep getting the same error "you dont have premission or something."

-
Heres where the script is located. !

-- Lastly the script itself.--
Try not to get the game
’s children, as there may be hidden services which are inaccessible by default means. You are looking for workspace
instead.
thats the only method i know since im new at lua. do you mean do for k,n in pairs (game.workspace()) do if n.Name == “lava” etc or (game.workspace:GetChildren())
workspace:GetChildren()
, which returns an array of the workspace’s children.
game.Workspace
works, but workspace
is a global. Both works, just write whatever fits, but the first one would be alternated to game:GetService("Workspace")
.
alright. thank you guys, its working now. i dont know to to mark as got the solution since you both did but still thanks!