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

Help with variable issue?[Unsolved]

Hey guys- Today I am trying to get an objects position and store it within a value that belongs specifically to a player. It sounds easy and it probably is but I just can't figure out why its not working out for me. Here's the local script.

local plyr = game.Players.LocalPlayer.Character
local shipposition = game.Workspace[Shipsname.Value].BodyKit.Grok.Position
	print(shipposition) -- This gives me the correct value
	plyr.Shipsposition.Value = shipposition
	game.Workspace[Shipsname.Value]:Destroy()

When I run the script the shipposition variable works just fine and it prints out the desired position without any errors but if I were to print out the Shipsposition value it would give me 0. I'll be happy to clarify on anything if I can, but thanks! lordrex12345

3 comments

0

I don't see anything wrong with this script?

0

Yea, I don't see anything wrong with it but when I try to assign the value of shipposition to Shipsposition, it won't work meaning Shipsposition remains as a 0 instead of changing.

0

Bump, still need some help with this guys.

1 answer

If you're trying to print the value of Shipsposition before line 4, it won't work because the value wasn't set.

2 comments

0

There are two different values referred to as shipposition.

0

I am not trying to print the value of Shipposition, I am trying to assign it...

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