My script dont work because it attempt to index nil with Data? here script
local debounce = false local summon = false local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(Input,IsTyping) if IsTyping then return end if Input.KeyCode == Enum.KeyCode.Q and Player.Data.HasStand.Value == true then if summon == false then summon = true print("summoned the stand") game.ReplicatedStorage.Jojo:WaitForChild("SummonStand"):FireServer() script.Parent:WaitForChild("Equip").Value = true elseif summon == true then print("destroyed the stand") summon = false game.ReplicatedStorage.Jojo:WaitForChild("DestroyStand"):FireServer() script.Parent:WaitForChild("Equip").Value = true end end end)
if Input.KeyCode == Enum.KeyCode.Q and Player.Data.HasStand.Value == true then
that is the line with the error i think
game.Player.PlayerAddded:Connect(function(player) local data = Instance.new("Folder") data.Name = "Data" data.Parent = player local hasStand = Instance.new("BoolValue") hasStand.Name = "HasStand" hasStand.Value = false hasStand.Parent = data local standName = Instance.new("StringValue") standName.Name = "StandName" standName.Parent = data end)
There the Data in server script service
When i press q it put the error there it say Players.superplayer1453.Backpack.Summoning:9: attempt to index nil with 'Data'
Closed as Not Constructive by JesseSong
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?