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

Function pseudo-sets value for some reason?

game.ServerStorage.toolactive.Event:Connect(function(player, mousetarget)
	if rock.Transparency ~= 1 then


		if mousetarget == rock then
			rock.Transparency = 1
			Owner.Value = player.Name	

			
			
			
			end
		end
	end)

This code sets the Owner value to the player name, and upon printing Owner.Value in the function it says it is the player name, BUT, upon printing outside the function the value has not changed.

The transparency change works which makes me even more confused.

I have no idea what causes this, any contributions are appreciated.

2 comments

0

Make sure Owner is defined

0

Everything in this is defined, the script is pretty long so I only included the part that was causing issues.

1 answer

✓ Accepted answer

I figured out how to get the player a different way with some tomfoolery on the server side.

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