Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Touched is not a valid member of Workspace?

Im Trying to make a game called Boulder Run Where you run from a boulder and i want to make a message saying who has survived the boulder by touching this invisible brick

h = Instance.new("Hint", game.Workspace)

local db = false
function onTouched(hit)
	if hit.Parent == nil then Print ("gun") return end
	if db then return end
	db = true
	local pName = game.Players:GetPlayerFromCharacter(hit.Parent)
	print(pName)
	h.Text = pName 
	wait(5)
	msg:remove()
	db = false
				
end

script.Parent.Touched:connect(onTouched)

1 comment

0

I copied this from wiki but It didnt work so I rewrote the entire script and made it almost entirely different I used the wiki as a Reference! :D

1 answer

You probably have the script placed in the Workspace. That's why it's telling you that "Touched" is not a member of Workspace. You should place the script inside a part.

This discussion is preserved as it was. New answers, comments, and votes are closed.