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

The BoolValue Wont Trip Player?

wait(1)--script load
local Player = script.Parent.Parent;

local Humanoid = Player:WaitForChild("Humanoid")
local Ragdoll = script.Parent.Value

while wait() do
if Ragdoll == true then
Humanoid.Sit = true
else
Humanoid.Sit = false
end
end

When the value is true nothing happens Same as false.

StarterPlayer > Ragdoll(boolvalue) > RagS(script)

2 comments

0

It's defining itself to the contents inside .Value; it's not going to update when the value changes. The solution's to set the variable as it is, local Ragdoll = script.Parent, then when you go to check you do if Ragdoll.Value == Bool then.

0

Still not works

1 answer

✓ Accepted answer

From the context given, I have assessed 3 distinct possible issues to this.

I'd first make sure the Boolean Value is not just placed within "StarterPlayer", rather within "StarterCharacterScripts." This would add the value inside the character.

Secondly, your code seems to be doing the right thing. However, rather than using a wait() loop, I'd switch to a .Changed event. This triggers when a certain property of the Boolean Value has been changed.

Here's my code:

wait(1)

local Player = script.Parent.Parent;
local Humanoid = Player:WaitForChild("Humanoid")
local Ragdoll = script.Parent

Ragdoll.Changed:connect(function(value)
    if value == true then
	    Humanoid.Sit = true
	else
	    Humanoid.Sit = false
	end
end)

This gets rid of the irritating loop.

Now, something to address is how you are testing this function. Simply going in testing mode and changing the Boolean Value to true or false is not going to cut it. The game is Filtering Enabled, thus, any changes made to this property is local.

You can add this simple loop to the bottom of your script to test it out:

while wait(1) do
    Ragdoll.Value = true
    wait(1)
    Ragdoll.Value = false
end

I hope this works out for you! LMK if any problems come up :)

`

1 comment

0

Works!

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