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

Another onTouch problem?

Like my last one but i made a place holder brick inside the block

block = script.Parent.Parent["Question Mark Block"]
place = script.Parent.Parent["Place holder block"]
function onTouch(hit) 
	game.ServerStorage["Question Mark Block Deactivate"]:Clone().Parent = block.Parent
	wait(0.1) --here
	script.Parent.Parent["Question Mark Block Deactivate"].Position = place.Position
	place.Parent.Touch.Script:Destroy()
	block:Destroy()
end
script.Parent.Touched:connect(onTouch)

Ive added the path on here. http://prntscr.com/92djsx

And again im not sure why its not working. It works upto the comment "--here"

1 comment

0

The variable block doesnt delete and the script doesnt destroy and also the block new question mark block doesnt move to the place holder block position

1 answer

✓ Accepted answer

Not sure if this would work for you but try this.

block = script.Parent.Parent["Question Mark Block"]
place = script.Parent.Parent["Place holder block"]
function onTouch(hit) 
	if hit.Parent:findFirstChild("Humanoid") then
    game.ServerStorage["Question Mark Block Deactivate"]:Clone().Parent = block.Parent
    wait(0.1) --here
    script.Parent.Parent["Question Mark Block Deactivate"].Position = place.Position
    place.Parent.Touch.Script:Destroy()
    block:Destroy()
	end
	end
script.Parent.Touched:connect(onTouch)

I did this quickly and I didn't test it on studio so yea.

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