Well i made a tool that has a function which fires an animation and should make a screen gui visible when the player is touching a certain part i tried to insert a boolvalue in the server storage it works but i always get a warning that value isn't a valid member of server storage? (The print touched works) This is a normal script
01 | script.Parent.Touched:Connect( function (hit) |
02 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
03 | print ( "Touched" ) |
04 | game.ServerStorage.Value = true |
05 | end |
06 | end ) |
07 |
08 | script.Parent.TouchEnded:Connect( function (hitend) |
09 | if hitend.Parent:FindFirstChild( "Humanoid" ) then |
10 | print ( "Touch ended" ) |
11 | game.ServerStorage.Value = false |
12 | end |
13 | end ) |
Maybe try this. The BoolValue can be put into a variable, so you don't have trouble.
01 | local Value = game.ServerStorage.YourBoolValueName.Value |
02 | script.Parent.Touched:Connect( function (hit) |
03 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
04 | print ( "Touched" ) |
05 | Value = true |
06 | end |
07 | end ) |
08 |
09 | script.Parent.TouchEnded:Connect( function (hitend) |
10 | if hitend.Parent:FindFirstChild( "Humanoid" ) then |
11 | print ( "Touch ended" ) |
12 | Value = false |
13 | end |
14 | end ) |
I didn't test this. If it doesn't work, I'm happy to keep helping. Good Luck on whatever you are making!