How do i do this properly, ive been trying to figure this out for like 12 hours.
what i want to do is for a door to not be opened untill task1 is complete, i finished the task changing becoming true thing in the local script( tell me if i should send) but i cant figure out why it stays false on the server script, the heartbeat is for checking what the attribute is right now, please help me
local ts = game:GetService("TweenService")
local player = game:GetService("Players")
local plr = player.LocalPlayer
local use = script.Parent:WaitForChild("ProximityPrompt")
local callendar = script.Parent
print(use)
print(callendar)
local player = game:GetService("Players").PlayerAdded:Wait()
print(player)
player:SetAttribute("Task1", false)
player:SetAttribute("Task2", false)
player:SetAttribute("Task3", false)
player:SetAttribute("Task4", false)
player:SetAttribute("Task5", false)
player:SetAttribute("Task6", false)
player:SetAttribute("Task7", false)
player:SetAttribute("Task8", false)
player:SetAttribute("Task9", false)
player:SetAttribute("Task9", false)
local rs = game:GetService("RunService")
local taskdone = player:GetAttribute("Task1")
print(taskdone)
local works = game:GetService("StarterGui")
local tween = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0, false, 0)
local rep = game:GetService("ReplicatedStorage")
local activated = false
local debounce = false
callendar.Orientation = Vector3.new(-90, 0, 0)
callendar.Position = Vector3.new(-123.71, 9.49, -176.33)
local dialoguemod = rep:WaitForChild("Forgot")
rs.Heartbeat:Connect(function()
taskdone = player:GetAttribute("Task1")
print(taskdone)
end)
use.Triggered:Connect(function(plr, sup, number)
print(taskdone)
if taskdone == true then return end
if not taskdone then
sup = "I cant forget my necklace, Its on top of my cabinet."
number = "0.1"
print(sup,number)
dialoguemod:FireClient(plr, sup, number)
end
end)
use.Triggered:Connect(function()
print( "triggered")
taskdone = player:GetAttribute("Task1")
if not taskdone then return end
print(taskdone)
if not activated and not debounce then
print("worked")
debounce = true
ts:Create(callendar, tween, {Orientation = Vector3.new(-90, -90, 0)}):Play()
ts:Create(callendar, tween, {Position = Vector3.new(-118.56, 9.49, -171.38)}):Play()
task.wait(1)
activated = true
debounce = false
elseif activated and not debounce then
print("worked")
debounce = true
ts:Create(callendar, tween, {Orientation = Vector3.new(-90, -0, 0)}):Play()
ts:Create(callendar, tween, {Position = Vector3.new(-123.76, 9.49, -176.58)}):Play()
task.wait(1)
activated = false
debounce = false
end
end)
---127.6, 10.51, -35.75