You’re trying to alter a value on the client in your LocalScript. This change will not be reflected on the server. I suggest you use RemoteEvents to communicate between the server and client. More information is provided in the following articles. If you have any further questions, please do not hesitate to ask! Roblox Client-Server Model RemoteEvent
In your server script, you save the value of the standneedtofind at the time the script begins running and will not change when the value itself changes. Instead, you should save the value OBJECT in a variable and check its value.
Also, I suggest using event instead of loops for efficiency purposes.
Make sure to ask more questions if you have any. I only brushed the surface of these concepts, so please do ask!
[quote=“MadionChooi, post:3, topic:1671423”]
i will show my full script this is just part of the script
local script
local value = script.Parent
while true do
wait()
value.Value = value.Parent.Text
end
this is the local script button that firethe server
local button = script.Parent
local frame = button.Parent
local player = game:GetService("Players").LocalPlayer
button.MouseButton1Click:Connect(function()
game:GetService("ReplicatedStorage").Obtainment.AdminGetStand:FireServer()
end)
this is the replicatedstorage
local rp = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local serverstorage = game:GetService("ServerStorage")
rp.Obtainment.AdminGetStand.OnServerEvent:Connect(function(player)
local playergui = player.PlayerGui.AdminGui.AdminFrame
print("ADMIN REQUESTED STAND " .. player.Name)
print(playergui.SkinName.NameValue.Value)
print(playergui.StandNames.NameValue.Value)
print(playergui.PlayerName.NameValue.Value)
local playertofind = game.Workspace:FindFirstChild(playergui.PlayerName.NameValue.Value)
if playertofind then
print(playertofind)
print("PLAYER FOUNDED")
local standneedtofind = playergui.StandNames.NameValue.Value
local findstand = serverstorage.Stand:FindFirstChild(standneedtofind):Clone()
if findstand then
print(findstand.Name)
print("STAND FOUNDED")
local findtheskin = playergui.SkinName.NameValue.Value
local findingskin = serverstorage.StandModel:FindFirstChild(standneedtofind):FindFirstChild(findtheskin):Clone()
if findingskin then
print("STANDSKIN FOUNDED")
print(findingskin.Name)
local Data = player:WaitForChild("PlrStats")
local standvalue = Data:FindFirstChild("Stand")
local skinvalue = Data:FindFirstChild("SkinName")
if standvalue then
if skinvalue then
local playerchar = players:GetPlayerFromCharacter(playertofind)
print("CHECKING IS THIS A NPC?")
if playerchar then
print("HE IS REAL PLAYER")
local standtogive = findstand:Clone()
findstand.Parent = playerchar.Backpack
print("ADMIN CHANGED DONE")
standvalue.Value = findstand.Name
skinvalue.Value = findingskin.Name
end
end
end
end
end
end
end)