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

How to name the value?

Asked by 3 years ago
Edited 3 years ago

I'm trying to make an Ad place so people can go there and promote games, groups , shops , gamespassess, you can also make friends and play tick tac toe! But I can't make the ownership value can you please help me, here is my script.

script.Parent.Touched:Connect(function()
    game.Players.LocalPlayer.Name = game.Workspace.Post1.Post.Post.PlayerName.Value
end)

2 answers

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Just set the value using

game.Workspace.Post1.Post.Post.PlayerName.Value = game.Players.LocalPlayer.Name
0
it says "attempt to index nill with name" I copy and pasted Blueturtle8908 79 — 3y
0
it says "attempt to index nill with name" I copy and pasted game.Workspace.Post1.Post.Post.PlayerName.Value = game.Players.LocalPlayer.Name Blueturtle8908 79 — 3y
0
That means that "PlayerName" doesn't exist. DietCokeTastesGood 111 — 3y
0
how do I fix it then? Blueturtle8908 79 — 3y
0
Your script probably identified the location wrong. DietCokeTastesGood 111 — 3y
Ad
Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

I suggest using a regular script because you are trying to change a global value.

script.Parent.Touched:Connect(function(player)
 game.Workspace.Post1.Post.Post.PlayerName.Value = player.Name
end)

The issue seems to be that you are trying to get "LocalPlayer" in a global script. "LocalPlayer" can only be indexed in a local script

0
I am using a Regular script Blueturtle8908 79 — 3y
0
Then the fact you are using a regular script is the issue. In your previous script you attempted to index "LocalPlayer" in a global script. LocalPlayer can only be found in a local script. tightanfall 110 — 3y

Answer this question