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

The part trips the player in studio, but not in the actual game. Why?

I have a part placed in Workspace, and here is the Server Script. It is meant to trip any players on touch!

local effectTime = 2

script.Parent.Touched:Connect(function(hitPart)
	local h = hitPart.Parent:FindFirstChildOfClass("Humanoid")
	if h then
		h:ChangeState(Enum.HumanoidStateType.FallingDown)
		wait(effectTime)
		h:ChangeState(Enum.HumanoidStateType.PlatformStanding)
	end
end)

In Studio, the script works fine, but in the actual game, the script did not do anything to the player. Also, there are no errors or warning messages in the Developer Console/Output.

Also, the game is FilteringEnabled!

What should I do? Any help will be appreciated! :)

7 comments

0

Try using a local script?

0

no it is FE! Plus, i might find it weird...

0

Oh, its FE. You should add that into your question.

0

there it is updated!

0

k

0

What does "FE!" mean?

0

FilteringEnabled = true

1 answer

I think your problem is on line 3

where it says "Connect" the 'c' needs to be lowercase so it should look like

script.Parent.Touched:connect(function(hitPart)

9 comments

0

plus filtering enabled isn't needed information because you're using a server script

0
  1. nope it does not work. 2. :connect() is now deprecated. http://wiki.roblox.com/index.php?title=RBXScriptSignal#Methods
0

Wow, I never knew connect was deprecated. Then I don't know what wrong. It looks perfectly fine.

0

https://www.roblox.com/games/278433318/CStarLams-Play-Place you can take a look at the problem in here. Try stepping on the red foil brick to look at the issue.

0

The permission levels on this place prevent you from entering.

0

whoops wait a sec...

0

ok the place is now for everyone!

0

I knew the reason why! For some humanoid states, it only works with a local script!

0

ahh. good thing you figured it out! -- 19 days later lol

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