Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Function pseudo-sets value for some reason?

Asked by 2 years ago
Edited 2 years ago
01game.ServerStorage.toolactive.Event:Connect(function(player, mousetarget)
02    if rock.Transparency ~= 1 then
03 
04 
05        if mousetarget == rock then
06            rock.Transparency = 1
07            Owner.Value = player.Name  
08 
09 
10 
11 
12            end
13        end
14    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.

0
Make sure Owner is defined CaptainGreenSeals 23 — 2y
0
Everything in this is defined, the script is pretty long so I only included the part that was causing issues. Stiles8353 35 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

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

Ad

Answer this question