Hey, so, I'm pretty sure I am being really dumb right now, however, I'm still going to ask. My problem is this: When I set a value in a script it won't update for my script when It sends its data.
This is my script that changes a value called 'Q1' in 'game.Workspace.OSLoader.Answers.Q1.Value'
script.Parent.Submit1.MouseButton1Down:Connect(function(player)
game.Workspace.OSLoader.Answers.Q1.Value = script.Parent.Box1.Text
end)
script.Parent.FeedbackButton.MouseButton1Down:Connect(function(player)
wait()
game.Workspace.OSLoader.Events.SPACER:FireServer("SpacerSent")
wait(1.5)
game.Workspace.OSLoader.Events.R1:FireServer("R1Sent")
wait()
game.Workspace.OSLoader.Events.R2:FireServer("R2Sent")
wait()
game.Workspace.OSLoader.Events.R3:FireServer("R3Sent")
wait()
game.Workspace.OSLoader.Events.R4:FireServer("R4Sent")
wait()
game.Workspace.OSLoader.Events.R5:FireServer("R5Sent")
wait()
game.Workspace.OSLoader.Events.R6:FireServer("R6Sent")
wait()
game.Workspace.OSLoader.Events.R7:FireServer("R7Sent")
wait()
game.Workspace.OSLoader.Events.R8:FireServer("R8Sent")
wait()
end)
At the top I am making it so when my button is pressed it sets the 'Q1's value to the text boxes text. This works fine I can see that it has changed the value, however when I use this script to post a message to google sheets it is blank (The default value of a string value)
databaseService = require(script.DatabaseService)
local globalDatabase = databaseService:GetDatabase("Global")
local Q1 = game.Workspace.OSLoader.Answers.Q1.Value
game.Workspace.OSLoader.Events.SPACER.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Name: "..player.Name.." | UserId: "..player.userId,"---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
end)
game.Workspace.OSLoader.Events.R1.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q1 From "..player.Name,Q1)
end)
game.Workspace.OSLoader.Events.R2.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q2 From "..player.Name,"Working? TEST2")
end)
game.Workspace.OSLoader.Events.R3.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q3 From "..player.Name,"Working? TEST3")
end)
game.Workspace.OSLoader.Events.R4.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q4 From "..player.Name,"Working? TEST4")
end)
game.Workspace.OSLoader.Events.R5.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q5 From "..player.Name,"Working? TEST5")
end)
game.Workspace.OSLoader.Events.R6.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q6 From "..player.Name,"Working? TEST6")
end)
game.Workspace.OSLoader.Events.R7.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q7 From "..player.Name,"Working? TEST7")
end)
game.Workspace.OSLoader.Events.R8.OnServerEvent:Connect(function(player)
globalDatabase:PostAsync("Q8 From "..player.Name,"Working? TEST8")
end)
print(globalDatabase:GetAsync("Cool People"))
It just won't update it, I don't understand why, If you can help that would be great!
-ItsDodgee

1 comment
v