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

How do i make ablock when i step on it it will make a sound and cframe?

I have tried this but none of it worked,none of it.

if part.Ontouched then
part.CFrame = part.CFrame.new (42, 0.59, 49)
msc = Instance.new("Sound", Workspace)
msc.SoundId="http://www.roblox.com/asset/?id=131111368"
while true do
    wait(10)
    msc:Play()
end

2 answers

You forgot a connection line for your player. Tip: Not everything that touches the part will always be a player. Also, you included a loop for no reason.

on = false

script.Parent.Touched:connect(function(hit)
	if hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) then
	if not on then
		on = true
		part.CFrame = part.CFrame.new (42, 0.59, 49)
		msc = Instance.new("Sound", script.Parent)
		msc.SoundId = "http://www.roblox.com/asset/?id=131111368"
		wait()
		msc:Play()
		wait(10)
		msg:Stop()
		on = false
	end
	end
end)

2 comments

0

Forget the awnser below your one.That one is telling me how to do nothing!

0

If I helped you out, accept my answer/bump up my reputation!

Where is ur connection line, is this the whole script?

1 comment

0

What are connection lines don't expect me to know?

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