script.Parent.Touched:connect(function(hit)
print(hit)
end)
My actual code is irrelevant, since the event never fires, so even this doesn't work. Help??
EDIT: It seems to only not fire when the player touches it. hm
script.Parent.Touched:connect(function(hit)
print(hit)
end)
My actual code is irrelevant, since the event never fires, so even this doesn't work. Help??
EDIT: It seems to only not fire when the player touches it. hm
Is the script parented to a block? If not, parent it to the block.
If that dosen't work, try this:
script.Parent.Touched:Connect(function (hit)
if not hit then -- if hit dosen't exist then...
print "oh noes!" -- uh oh! :(
return nil -- exit program
end
-- now this only runs if hit exists.
print(hit.Name,',',hit.Parent.Name) -- should be something like "LimbName , PlayerName"
end)
--it should be
script.Parent.Touched:Connect(function(hit)
print(hit.Name)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
What type of script is it? Where's it parented? Are there any errors?
For me it works. Where did you locate the part with the script? Also does it shows any errors?
Its parent is the block itself. No errors. @Doobb_yyus
I may have found the source of the problem, the old roblox loading script I'm using puts all parts in the camera for some strange, absurd reason. i don't really know how to fix that, sans rooting out the autorespawn script i wrote and deleting it...
try doing a if statment, if a humanoid exists